UKHeliBob:
Which works
Jeez - that will really confuse folk ![]()
...R
UKHeliBob:
Which works
Jeez - that will really confuse folk ![]()
...R
UKHeliBob:
I expect that you meantchar h = 'h';
char e = 'e';
char l = 'l';
char o = 'o';
char characters[] = {h, e, l, l, o};
Which works :)
This is a new style of declaring an array; so, it is enjoyable. We have seen the following styles:
char characters[] = {'h', 'e', 'l', 'l', 'o'};
char characters[] = "hello";
char characters[] = {0x68, 0x65, 0x6C, 0x6C, 0x6F}; //direct ASCII codes
You forgotchar characters[] {'h', 'e', 'l', 'l', 'o'};
AWOL:
You forgotchar characters[] {'h', 'e', 'l', 'l', 'o'};
I have learnt two things (upto now) from this thread --
A post is targeted to the immediate previous poster if no specific poster is mentioned.
An array can be initialized/declared/defined this way:
char characters[] {'h', 'e', 'l', 'l', 'o'};.
Robin2:
Jeez - that will really confuse folk...R
Probably, but it does prove that groundFungus's declaration code, although incomplete, would have worked ![]()
We have seen the following styles:
char characters[] = {'h', 'e', 'l', 'l', 'o'};
char characters[] = "hello";
char characters[] = {0x68, 0x65, 0x6C, 0x6C, 0x6F}; //direct ASCII codes
Note that not all of those declarations result in the same array
AWOL:
More homework questions...
From a sock puppet.
(Other account restored. It's been more than a month.)
Thank you moderator, Very cool!