I understand then that the method i've been using leads me nowhere. But what do you mean by 2) ?? I use this usually char buffer[100] but i can read it into a string anyway with this:
...
What? Binary data? What can i use then (You do realize after the chars of 0 1 2 3 4 etc) i do get letters so what do i use? Even appending correct letters 1 at a time doesn't work :( What the hell!
I am using sockets to receive, so len is len the real length. The reason why i use len in the first place, is because the characters i receive are for example the char of 0. I shall try again but i...
char* get(char buffer[],int from, int until, int len)
{
int a = from;
int b = 0;
int end = from+until;
char *lol;
lol = new char[until+1];
while (a < len && a <= end) {
lol[b] = buffer[a];...
Weird... Doing it like that, i get a bunch of -1's for recv (I am using select command to detect if its time to receive) and sometimes 2 and 1 etc... So i am not sure whats going on...
Thanks for the info. Btw, by doing setting the limit to 4 each time, Wouldn't that mean i will not know the end of the message; Assuming i get, for example, 2 messages sent to me at once?
I am using an integer to receive values from sockets (recv). But i need them as ascii values, but they need to be able to go higher than 255, which is the reason i cannot use char for the recv.
That may be so, but i have given u enough clues. I used char buffer[size] for recv and used buffer[0] etc to interpret the message eg if (int)buffer[0] == 2 { eat_kellogs; }
I found that doing this: printf("%d %d %d %d",buffer) using int to receive it, would print out many numbers which are different, more specifically the other values received, so now it would be nice...
Problem: I cannot use it as an array? how can i get the data? as the program i have sends numbers like 0 1 2 3 4 5 (as chars). but when i use that int, it just comes a bunch of numbers
I am using sockets to receive chars over 256 and as you know char has a range from -128 to 127. Theres my problem, i cannot use anything besides char to recv. Is there any way to convert it to...