|
-
October 1st, 2008, 08:30 PM
#16
Re: I'm SICK of THIS! WHY THIS CODE DOES NOT WORK!
char *body[line][charLength];
Guys, correct me if I'm wrong but I do believe this is declaring a 3D array, not a 2D like he wants.
-
October 1st, 2008, 08:37 PM
#17
Re: I'm SICK of THIS! WHY THIS CODE DOES NOT WORK!
True, a (well-known) typo. However, if you mix up [] with () when DECLARING a vector, any average compiler will catch that up.
ariell
programming is understanding
-
October 1st, 2008, 09:20 PM
#18
Re: I'm SICK of THIS! WHY THIS CODE DOES NOT WORK!
 Originally Posted by ariell
First of all, this is what is printed right under your name. It must not catch you by surprise, that a newbee like me recognizes such details.
It's just related to post count. I didn't notice it had changed.
Everything you say is right, and I am definitely not supposed to warm up stack/heap discussions. However, in the given context, your words are "incomplete". I tried to explain that bounds (defined as having to be constant) are to "work-around" with vectors to show the decisive difference: Constant expressions are SIMPLE expressions, evaluated by a compiler BEFORE an app is LINKED. A vector (object) assigned with a var (which "n" is in my example), will be determined at RUNTIME.
Maybe I took a strange approach, sorry in advance.
All true (although I would describe it in terms of class semantics). I was simply mentioning that the "copying" statement didn't seem relevant to any of that. Nothing you said was wrong; but your phrasing implied a causal relationship which I don't think exists. But that's neither here nor there.
P.S. is it always that dangerous to post here?
You think that's "dangerous", you obviously didn't see any of the Star Trek forums the day Enterprise was canceled.
Last edited by Lindley; October 1st, 2008 at 09:27 PM.
-
October 1st, 2008, 09:55 PM
#19
Re: I'm SICK of THIS! WHY THIS CODE DOES NOT WORK!
Use string rather than char array.
If you want multidimensional char array is this syntax.
char *aStr[10] -- Need allocate memory
char aStr[10][200] Not require allocate memory on runtime.
Both syntax is same.
I hope this help.
-
October 1st, 2008, 10:28 PM
#20
Re: I'm SICK of THIS! WHY THIS CODE DOES NOT WORK!
 Originally Posted by jmass16
char *body[line][charLength];
Guys, correct me if I'm wrong but I do believe this is declaring a 3D array, not a 2D like he wants.
Technically, yes. The final dimension stores a pointer to a null-terminated array of char's, aka a c-style string. In that context most people will talk about a 2D array of strings rather than a 3D array of char.
-
October 2nd, 2008, 08:31 AM
#21
Re: I'm SICK of THIS! WHY THIS CODE DOES NOT WORK!
First of all: Thanks for that StarTrek hint - I didn't laugh like that in a long time.
Just dropped by cos I started a big compile/build, which is a perfect chance to have a break.
I agree with putting it in the context of class semantics, it is definitely more precise. Be that as it may, when you're new and feel to be under attack you'll try to make a post as short as possible.
However, not, that things are "calmed", I feel much better, and I learned, that boards/forums is quite obviously not what I am good for.
A great time to everybody, and best from the south.
ariell
programming is understanding
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|