Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Printing the last item of a structure twice
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="jameskuyper, post: 3910981"] The C++ standard library includes essentially all of the C standard library by reference, with only a few minor modifications. The overwhelming majority of C standard library function calls work exactly the same in C++. The only exceptions: strchr(), strpbrk(), strrchr(), strstr(), memchr(), are all provided with two overloads; one with parameters that are pointers to const, and with a return type that is a pointer to const, and one with ordinary pointer parameters that returns a the same pointer type. It is very hard to write C code whose meaning or validity would be affected by this difference, except by using function pointers. wchar_t, and, and_eq, bitand, bitor, compl, not_eq, not, or, or_eq, xor, and xor_eq are all C++ keywords, rather than being typdefed or #defined in the appropriate standard headers. The expansion of the NULL macro cannot be an expression with a type of void*, something that C permits. It can be expression that retrieves the name of static const variable explicitly initialized by an integer constant expression with a value of 0, something C would not permit. However, in practice, there's no good reason for it to be anything other than '0'. longjmp() has undefined behavior under certain circumstances in C++, that can't even occur in C code. offsetof cannot be applied to certain type of structs that can't even be defined in C. The malloc() family is guaranteed to not operate by calling operator new() or operator delete() (the reverse, however, is permitted); such a guarantee is meaningless in C code. exit(), atexit(), and abort() interact with various other C++ features in ways that are not meaningful in C code. For the most part, you can read C++ code that uses C standard library functions, without worrying about any of the above differences. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Printing the last item of a structure twice
Top