Thanks Dave!
Type: Posts; User: irncty99
Thanks Dave!
I do not want the padding bytes.
I'm not worried about endian-ness.
There are no pointers in the structure.
I'm mainly just looking for a C syntax example.
Can somebody please tell me how go about copying the elements of a structure into a byte array. Your assistance is greatly appreciated.
Thanks in advance!
When I insert the below code into my program, I get a core. Can somebody maybe point out any obvious problems? Thanks in advance:
code...
disregard the fflush solution. I did a work around:
code:
__________________________________________
sendRegisterSymbol()
{
char tmp[256];
static bool firstTime=true;
CSIString...
so would it make sense to do a fflush(stdin); as soon as the sendRegisterSymbol() method is called? I would think so, but it doesn't seem to be helping.
I'm having a problem with prompting and getting user input. Below is my code
sendRegisterSymbol()
{
char tmp[256];
CSIString domain;
CSIString mfile;
CSIString instance;
I have a Class called CSIString, but in that class there is no method to clear a string. I want to write my own method, and I'm thinking I should just be able to do something like:
str = "";
...
That last solution works fine for my first case of reading in a blank 1st field, but now if I have something like:
pMsg = field1|field2||field4
with a blank field in the middle somewhere, then...
This is what I'm doing:
/*CODE
char* pToken = strtok(pMsg, "|");
if (pToken)
token1 = pToken;
else
token1 = "";
I currently have a string delimited with pipes:
i.e. : pMsg = str1|str2|str3|str4
This string is tokenized using strtok. As long as all the strings are not empty, this works fine. After strtok...