const help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
beyondsociety

Re:const help

Post by beyondsociety »

Hey tom, I have a few error problems that I need help with in TC. I have only posted one because I replying during class at college. I'll post the rest of my errors tommorow for you to look at. Thanks for the help!.

void GetChar();
{
scanf(stdin,"%c",&Look);
}

I get a Suspicious pointer conversion in function GetChar.
Schol-R-LEA

Re:const help

Post by Schol-R-LEA »

Tim Robinson wrote: The OP's use of the ^ character in the original source (e.g. ^G) is the Pascal way of specifying control characters (read ^G as Ctrl+G). ^A is ASCII 1, ^B = 2, ^C = 3, etc. Hence ^I becomes Tab, which is '\t' in C.
Oops, you're right. While it is true that the caret is used for pointer deref, I was mistaken in the syntax, however; the correct syntax is "foo^", not "^foo" as it appears in the code example. Therefore, it cannot be a pointer dereference. While "^foo" is the declaration syntax for pointers, in the context it was clearly setting the TAB character constant, which is, indeed, equal to ctrl-I. Sorry about that.
beyondsociety

Re:const help

Post by beyondsociety »

[attachment deleted by admin]
Tom

Re:const help

Post by Tom »

[attachment deleted by admin]
Whatever5k

Re:const help

Post by Whatever5k »

Actually, this doesn't fit into this topic, but I'll continue anyway...:
Why do you all introduce comments in C with a double-slash ('//')? This is not C, but C++! In C, there is only the /* and the */. However, gcc supports it - but it's definetely *not* ANSI C. So, better use /* */ so that other compilers don't have problems with that...
Tim

Re:const help

Post by Tim »

but it's definetely *not* ANSI C
It is, as of 1999 (the ISO C99 standard).
Post Reply