Yeah I got the name. on here you must spend a lot of time looking wistfully at the bottle.
I never said anything about null pointers. "" IS NOT a null pointer! it is an empty string in C/C++ that is represented by the character "\0"
yeah i got a bottle with your name on it now...
we have been talking about null and 0 and you mentioned C pointers... hello context!!...
look... regarding false, null, nothing, 0, undefined, etc., etc.
each of these has specific meanings that correlate with actual concepts. sometimes multiple meanings are overloaded into a single keyword or value.
in C and C++, NULL, false and 0 are overloaded to the same value (in my opinion, C is 'broken' in that respect). in C# they're 3 distinct concepts.
null or NULL usually indicates a lack of value, but usually doesn't specify why. 0 indicates the natural number zero and has type-equivalence to 1, 2, 3, etc.
and in languages that support separate concepts of NULL should be treated only a number.false indicates non-truth. and it used in binary values. it doesn't mean unset, nor does it mean 0... it simply indicates one of two binary values...
nothing can indicate that the value is specifically set to be nothing which indicates the same thing as null, but with intent...
undefined in some languages indicates that the value has yet to be set because no code has specified an actual value...
now try this on a C compiler.
your example is barely even tangential to the discussion... you are
converting string to integer which is not what thecuttingedge's "pseudocode" as you call it was doing... is it?
but thank you for proving my point that strings are not integers and must be converted to like type before compare.
Reread your paragraph about psuedocode. your interpretation is simply different from mine thats it. psuedocode can be totally different depending on the language you are used to. psuedocode for Python would be different from psuedocode for PERL. The Parentheses and Braces you added where superfluous and are not usually shown is psuedocode, unless it was necessary or simply easier/quicker/clearer.
SO. Yeah I have spent a bit of time on there.
i am aware what pseudocode is.
if you insist on being pedantic, please spell it correctly... and no, it doesn't have to look any different in python, perl, pascal, c or any other language you can think of... that's the point of pseudocode...
eg:
extract the next word from the line (good)
set word to get next token (poor)
append the file extension to the name (good)
name = name + extension (poor)
FOR all the characters in the name (good)
FOR character = first to last (ok)
another eg:
set total to zero
set grade counter to one
while grade counter is less than or equal to ten
input the next grade
add the grade into the total
set the class average to the total divided by ten
print the class average.
furthermore,
i wasn't showing pseudocode... i was showing actual code that
would compile... what are you going on about?