[gameprogrammer] Re: problem filling a buffer
- From: Roger D Vargas <luo_hei@xxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 21 Mar 2007 16:23:06 -0500
Rasmus Toftdahl Olesen escribió:
One thing that could ease filling a buffer i to just use a structure to
hold your data, and then pass a pointer to that as the buffer, e.g.:
static const int COMMAND_LOGIN = 20;
static const int MAX_STRING = 10;
typedef struct {
int command;
char username[MAX_STRING];
char password[MAX_STRING];
} Login;
Thanks for illustrating the use of SDLNet_Write. I will switch all my
code to use it. But in this case, the compiler does not includes padding
or something to align struct members?
--
http://dsgp.blogspot.com | Linux, programación, juegos
Have no place I can be since I found Serenity
But you can’t take the sky from me
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: problem filling a buffer
- From: Rasmus Toftdahl Olesen
- References:
- [gameprogrammer] problem filling a buffer
- From: Roger D Vargas
- [gameprogrammer] Re: problem filling a buffer
- From: Rasmus Toftdahl Olesen
Other related posts:
- » [gameprogrammer] problem filling a buffer
- » [gameprogrammer] Re: problem filling a buffer
- » [gameprogrammer] Re: problem filling a buffer
- » [gameprogrammer] Re: problem filling a buffer
One thing that could ease filling a buffer i to just use a structure to
hold your data, and then pass a pointer to that as the buffer, e.g.:
static const int COMMAND_LOGIN = 20;
static const int MAX_STRING = 10;
typedef struct {
int command;
char username[MAX_STRING];
char password[MAX_STRING];
} Login;
- [gameprogrammer] Re: problem filling a buffer
- From: Rasmus Toftdahl Olesen
- [gameprogrammer] problem filling a buffer
- From: Roger D Vargas
- [gameprogrammer] Re: problem filling a buffer
- From: Rasmus Toftdahl Olesen