Character Array in C
Character Array in C
- Subject: Character Array in C
- From: Michael <email@hidden>
- Date: Mon, 3 Apr 2006 13:08:48 -0700
Sorry...sent to the wrong group.
Could anyone please offer some advice:
Trying to play with character arrays in C, the code below generates
this error.
Anyone see something wrong?
thank you in advance.
>>>>>>>>
#include <stdio.h>
void test(char s[]);
char helloworld[11];
int main () {
printf("%s", test(helloworld)); // <----Invalid use of void
expression
return 0;
}
void test (char t[])
{
t[0]='H';
t[1]='e';
t[2]='l';
t[3]='l';
t[4]='o';
t[5]=' ';
t[6]='W';
t[7]='o';
t[8]='r';
t[9]='l';
t[10]='d';
t[11]='\0';
}
>>>>>>>>>>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden