Herzlich Willkommen, lieber Gast!
  Sie befinden sich hier:

  Forum » C / C++ (GNU/Linux, *NIX, *BSD und Co) » c socket send commands in string

Forum | Hilfe | Team | Links | Impressum | > Suche < | Mitglieder | Registrieren | Einloggen
  Quicklinks: MSDN-Online || STL || clib Reference Grundlagen || Literatur || E-Books || Zubehör || > F.A.Q. < || Downloads   

Autor Thread - Seiten: > 1 <
000
04.05.2011, 21:44 Uhr
~cheloveg
Gast


Hello, i am new in the socket programming in C/C++. I wrote Client and Server Socket. They can send and receive string. The idea is to send the commands to the server in the string. It can look something like this : "GET X" or "SET X 2". I know how i can split string. and the program know that the first word in the string is command, the second is attribute, and the third can be a value in case of SET-Command. My question is how i can say to programm that if it gets the string "GET X" it should call the function get(attribute). I thought the first about switch-case, but i think it's not a best solution for it. In case if it will be a lot of commands. THank you
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
001
04.05.2011, 22:13 Uhr
FloSoft
Medialer Over-Flow
(Administrator)


einmal reicht ... doppelpost
--
class God : public ChuckNorris { };

Dieser Post wurde am 04.05.2011 um 22:13 Uhr von FloSoft editiert.
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
Seiten: > 1 <     [ C / C++ (GNU/Linux, *NIX, *BSD und Co) ]  


ThWBoard 2.73 FloSoft-Edition
© by Paul Baecher & Felix Gonschorek (www.thwboard.de)

Anpassungen des Forums
© by Flo-Soft (www.flo-soft.de)

Sie sind Besucher: