Actually got it there now, what i have is:
#define START(x) (x) == 4| (x) == 8
If any better way let us know
Thanks
Type: Posts; User: newbie30
Actually got it there now, what i have is:
#define START(x) (x) == 4| (x) == 8
If any better way let us know
Thanks
Hi All;
Looking for hepl with a simple macro or even is it possible. I can do macro functions but this is annoying me.
Basically i have a #define called START. I want start to have two...
Thanks for the replies .
Basically my unsigned char array will hold 0x00 0x00
if value is 144 Dec i like it to be 0090 in array in hex. so maybe i should use %x in sprintf?
thks
Hi all;
I basically want to add leading zero's to a char when going from int to a char in snprintf.
See example :
unsigned char len[2];
int length = 144;
I was more so looking for people's opinions what they used than jsut going by wikipedia.
Surely as engineers we must have opinions on tools????
HI;
I am doing a project on looking at free ware memory leak tools for C on linux.
Now i know there is the commerical ones ie Purify which is a great tool but I like to know what you use and...
HI
We used openlog here and I was wondering do any one know why it prints out
"calling openlog() with 160" on startup on the terminal ???? It has to do with the option part which we have set...
struct TMP *tmp
char *buf_ptr;
buf_ptr = tmp->tr[i].ch_ptr;
tmp->tr[i].ch_ptr = NULL
tmp is a pointer to a struct TMP and tr is another pointer to another struct within tmp.
Hi;
Can someone point me to a good tutorial of state machines in C and good examples also.
Thanks
Grand cheers for that, just couldnt remember if it was ok or not. Size is grand as all taken care of!
Thanks
I have an array and also a buffer of char*
I have memcpy from buffer into the array, is this ok or should i memcpy into another buffer of char* and free it when done?
I dont have to free an...
cheers always get those slashes wrong!
buf2 will have enough space.
If i have the a pointer called buf1 and it contains aload of data, is it ok to do the following:
char *buf2
memset(buf2, '/0' 70);
strncpy(buf2, buf1, 70);
Right i have the following:
char *G_PTR = NULL //its a global
in a module i have this
Thats great but my problem is i want to assign something to the array at global scope.??
Sorry should of said that!
I have this say:
struct temp1 {
char *p;
short len;
};
Later on i have this : struct temp1 ARRAY[] = { some stuff};
Say we have 2 arrays of size ten, the second array as 6 ints in it.
If i do a memcpy(array1, array2 10);
Will i get rubbish in the after the 6 spot in the array1 or will memcpy set them to null;...
Hi;
I have a project where i am doing some parity checking.
Basically i have an array that contains values that cant be parity, ie 3,5,9 etc.
A buffer filled with a message of bytes .
So...
Read my post above.
Ask yourself what you need to do next logical before programming and look up what i said above.
When you asked the second user for their input, think about how do you compare the two inputs.
If any doubt on the compare look up switch statements, if statements, loops.
These are things you...
If you think about this there is not too much for it.
You need to take in char type from each user.
Create an if statement to do the compare
Print your result!!
Load of examples of this on...
Hi;
I have a client/server but i keep getting an error when i run the program. When the socket is blocking it works but non blocking it doesnt.
Here is the server code
#include <stdio.h>...
Can you post the code including the headers
So if i have a clietn/server both non blocking and i want to send data across i should not use the select option on the server side???
I write some rough code here but hope you get what i mean as...
Thanks for that, if you could answer my question on the sockets in the other post be great, as totally confused myself with the non blocking stuff