N
nick048
Hi
In the main I have declared a variable
char string[100];
I need to construct this variable with a function and I have written
the code:
char stringReceived(int sockDesc){
char unsigned c;
char tmp[100] = " ";
int i=0;
int n;
do {
n = recv(sockDesc, &c, 1, 0); // this function exist for
client/server dialog and is not rilevant for my problem
if (c!='\n'){
tmp=c;
i++;}
} while( c!='\n' );
tmp='\0';
return(tmp);
}
In the main I call:
string = stringReceived(nSocketDesc);
When I compile the program, this error is returned:
incompatible types assignement in function stringReceived and the line
number is the call.
Sure I mistake the declaration of function, but i don't be able to
correct the problem.
Can someone help me ?
Best Regards
Nick
In the main I have declared a variable
char string[100];
I need to construct this variable with a function and I have written
the code:
char stringReceived(int sockDesc){
char unsigned c;
char tmp[100] = " ";
int i=0;
int n;
do {
n = recv(sockDesc, &c, 1, 0); // this function exist for
client/server dialog and is not rilevant for my problem
if (c!='\n'){
tmp=c;
i++;}
} while( c!='\n' );
tmp='\0';
return(tmp);
}
In the main I call:
string = stringReceived(nSocketDesc);
When I compile the program, this error is returned:
incompatible types assignement in function stringReceived and the line
number is the call.
Sure I mistake the declaration of function, but i don't be able to
correct the problem.
Can someone help me ?
Best Regards
Nick