On 2010-08-31, Jean-Claude ROVIER <> wrote:
> I'm really sorry for the dumbness of my questions but I'm from the TP/Pas
> world.
What's that?
> Before I get enough money to buy to good C/C++ compiler (for DOS/Win/NT,
> any suggestions
)
djgpp or whatever they call it these days. Free. Pretty good.
> and start learning C/C++,
C and C++ are two different languages. Pick one.
> Here are the supid questions:
> 1st:
> I've got p as a pointer on a CStruct. p = *CStruct. No matter was CStruct
> is.
> If the program does 'MyPointer = p++' what does this mean?
I have no idea what you're writing here.
In general, "x = p++", in C, means the same as:
x = p;
p = p + 1;
That is to say, x is assigned the previous value of p, and p is incremented.
(When a pointer in C is incremented, it points to the next object of whatever
type it's a pointer to, so if you have a pointer to a CStruct, it will
point to the following CStruct.)
> 'if !(a = b)' means
This is a syntax error. It needs ()s.
> 1) if not a equal b (Hmmm I really don't believe this: equal is '==' not
> '=')
> 2) a=b and if b=0 then....
> 3) something else?
if (!expr) {
}
executes the code if expr is equal to zero.
a = b
assigns b's value into a, then yields a's value.
Thus,
if (!(a = b)) {
/* code */
}
assigns b's current value into a, and if the result is zero, executes code.
> Third stupid question:
> When I use a _fmalloc(size). Would that block be 'de-allocated' on exit? I
> couldn't find the 'dealloc' function in the prog.
Very good question. "_fmalloc" is not a standard C function. On most
implementations I've used, all program memory is freed automatically
on exit, but this function may behave differently.
> If someone knows where to find basic c++ help (*.hlp, *.doc,...) on the
> net...
No clue, I don't do C++.
> Thanks a lot for your help, and please excuse the stupidity of my
> questions.
Stupidity is bearable, but I can tell you something you MUST do:
Be. More. Careful.
C is an extremely picky language. The punctuation MATTERS. You cannot
just paraphrase or type from memory unless your memory is a LOT better
than it apparently is now. If you are making the same kinds of errors
in transcription and translation that you made in creating this post, you
are not producing anything that will be of value to you or anyone else.
-s
--
Copyright 2010, all wrongs reversed. Peter Seebach /
usenet-
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.