foo char [20];

Hi there I am trying to follow the tutorial for char arrays however when I type


foo char [20];

foo

(no holding boxes beneath)

I don't get the square holding boxes would someone be kind enough to help please...



What do you mean by "holding boxes" ?
Do you mean that the picture of boxes on this page

http://www.cplusplus.com/doc/tutorial/arrays/

doesn't appear?
The type of the array elements goes first.
 
char foo[20];
Hi thanks guys

yes moschops that's what I mean I having real trouble learning the different char variations for instance

char a;
a= 2;

does not build or run.
Build a complete C++ program. What you're looking at on that page isn't a complete program.

1
2
3
4
5
int main()
{
  char a;
  a = 'x';
}
Topic archived. No new replies allowed.