• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Character Array in C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Character Array in C
  • Next by Date: Re: Character Array in C
  • Previous by thread: Re: Character Array in C
  • Next by thread: Re: Character Array in C
  • Index(es):
    • Date
    • Thread