Crazy stuff... just taking on array programming and much like anything else programming I do, nothin'werks loll
What am I doing wrong (again); I(we) don't know the size of the rows but do know its a 4 col array. Why this keeps telling me I have a size of 2 (two) despite having 3 rows? I was sure I've read the rows can be omitted.
Troubleshooting I've done: 1) doing it again, restarting the IDE, the computer, went for walk, dbl-ed up coffee.... nothing'werks
Yup, very true Removing those lil assterix trows out a grand collection of exceptions, so...
sketch_jul13a:6:23: error: too many initializers for 'char [4]'
exit status 1
too many initializers for 'char [4]'
nut sure where to take this. Any half-decent tutorials on array for beginner? from the look of it the one I've picked nearly got me to quit and outsource to fivver LOL
Seriously? as in, that's all that was needed to get this to work??...
Spent a few more hours than I could afford-to-spend on this array training. And from the look it seems I'm not even near the end of learning more about arrays ;/
ps: left you a grateful subliminal note in the myArray[][4]. See above! Thx AWOL
man oh man, took my Friday to learn new tricks hoping to get some endless loops from previous code squeezed down in size (and IO). Kinda in sorting-out-old-programs time! So far so good, just long hours learning that's all. Sorry for the panic attack
GTC:
Yup, very true Removing those lil assterix trows out a grand collection of exceptions, so...
sketch_jul13a:6:23: error: too many initializers for 'char [4]'
exit status 1
too many initializers for 'char [4]'
nut sure where to take this. Any half-decent tutorials on array for beginner? from the look of it the one I've picked nearly got me to quit and outsource to fivver LOL
That particular error is caused by enclosing the characters in double quotes instead of single quotes. The correct form would be:
david_2018:
That particular error is caused by enclosing the characters in double quotes instead of single quotes.
Oh Good catch David, thanks for letting me know, didn't know. Due to spending too much time dev'ing with C# I'm starting to assume everyone else uses the same syntax. Need to revisit the good old school printf() days I guess.
Here is a slightly more generic example. It gives warnings about the initializers being too long (because there is no room for the null terminator) but should work for 2D arrays with up to 255 rows or columns.