[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
talk:C-Programming-Tutorial
This page is to discuss "C-Programming-Tutorial". You can ask questions or make comments.
What is a talkpage?
Since the author of the tutorial states that it might not follow ANSI C here and there, I didn't change anything in it, but here are some comments about minor things inside it that are different from ANSI C:

The return 0; statement. This statement simply says, that our main function returns zero on success and -1 if not.

It returns 0 on success, but what is returns on error is platform dependant.





bool

There are no such thing as bool in ANSI C. bool is C++. The ANSI ISO/IEC 9899:1999 (aka "C99") introduces a boolean type, but it is spelled _Bool.



This list covers almost all data types supported by C. However, i have excluded one, because it belongs neither to elementary nor customized data types: pointers.

C also supports union.



unsigned short j;
j = -1;


While this is legal C, I doubt it is pedagogical to assign a negative value to an unsigned variable (C++ would give a warning, but most C compilers won't). Was it made on purpose, and in that case, shouldn't it be signed?

/ Lundin


last edited (July 6, 2006) by Lundin, Number of views: 682, Current Rev: 1

[Edit this page]  [Page history]  [What links here]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.