| | |
Difference between C and C++
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2008
Posts: 32
Reputation:
Solved Threads: 0
Please tell me about some functions that we can not use in C.
•
•
Join Date: May 2008
Posts: 87
Reputation:
Solved Threads: 8
Well...those links have a lot of the differences. I think basically C++ is an extension of C with added features. You can still use C code in C++, and code in a "C-Style", but C++ has features that do away with some C stuff.
In terms of abstraction from the machine, C is very low level. It was designed to be basically a thin layer over the machine, providing the functionality and sort of direct interfacing of machine-level or assembly-code, but being portable (assembly and machine code is not portable, i.e. it is dependent on the architecture). You should read about the history of C...here is one place to start.
So then, C++ is an extension to the C language. It has added functionality. In particular, it has a rather extensive standard library (compared to C), or rather has an extended library. It also supports the idea of objects and classes, and supports large-scale projects and security better than does C. You should read about the history of C++ as well and read the links provided above to get some of the more technical differences.
Uhhhh well I really was only learning C in school, and am just sort of learning C++ because. Everywhere I look (and from what my profs tell me) you should learn C first, and then learn C++ (easy transition). In terms of actual functions, well:
One thing I noticed right away when I switched was that C++ programmers love to use strings (i.e. the string class) whereas we (the C users) had to constantly be using pointers to characters...aha. Vectors also seem to be used a lot, rather than dynamically allocated arrays or perhaps more suitable custom-designed structs...Another thing (more annoyance really) is that there is no boolean type in C -- just meant you had to #define TRUE and FALSE if you wanted to use them instead of integers. Uhh I also tend to not use the standard library so much, partly because my prof forbade us from using it and made us implement everything ourselves, and also because the C library is not as large..but C++ users (at least the ones here) tend to use STL extensively. Classes are really just structs in disguise (ahaha), but they have some other cool features (that I am still investigating). Ummm there are a lot of other differences, but they are also similar in so many ways. My advice: learn C, and you will know C++ (or the transition will not be difficult). Don't start with C++, because you will probably not want to go back and learn C.
In terms of abstraction from the machine, C is very low level. It was designed to be basically a thin layer over the machine, providing the functionality and sort of direct interfacing of machine-level or assembly-code, but being portable (assembly and machine code is not portable, i.e. it is dependent on the architecture). You should read about the history of C...here is one place to start.
So then, C++ is an extension to the C language. It has added functionality. In particular, it has a rather extensive standard library (compared to C), or rather has an extended library. It also supports the idea of objects and classes, and supports large-scale projects and security better than does C. You should read about the history of C++ as well and read the links provided above to get some of the more technical differences.
Uhhhh well I really was only learning C in school, and am just sort of learning C++ because. Everywhere I look (and from what my profs tell me) you should learn C first, and then learn C++ (easy transition). In terms of actual functions, well:
One thing I noticed right away when I switched was that C++ programmers love to use strings (i.e. the string class) whereas we (the C users) had to constantly be using pointers to characters...aha. Vectors also seem to be used a lot, rather than dynamically allocated arrays or perhaps more suitable custom-designed structs...Another thing (more annoyance really) is that there is no boolean type in C -- just meant you had to #define TRUE and FALSE if you wanted to use them instead of integers. Uhh I also tend to not use the standard library so much, partly because my prof forbade us from using it and made us implement everything ourselves, and also because the C library is not as large..but C++ users (at least the ones here) tend to use STL extensively. Classes are really just structs in disguise (ahaha), but they have some other cool features (that I am still investigating). Ummm there are a lot of other differences, but they are also similar in so many ways. My advice: learn C, and you will know C++ (or the transition will not be difficult). Don't start with C++, because you will probably not want to go back and learn C.
Optimist: This glass is half full!
Pessimist: This glass is half empty!
Engineering Consultant: This glass is twice as big as it needs to be...
Pessimist: This glass is half empty!
Engineering Consultant: This glass is twice as big as it needs to be...
![]() |
Similar Threads
- what is the difference between regular and 64 bit edition (Windows NT / 2000 / XP)
- Should replacing a 15" laptop screen with 14.1" make a difference? (Monitors, Displays and Video Cards)
- 56k and 56k/v90 difference? (Windows 95 / 98 / Me)
- date difference in c++ (C++)
- Drawbacks And Difference (C)
- "difference patching" help (C)
- The difference between functions and templates? (C++)
- Difference (Web Browsers)
Other Threads in the C++ Forum
- Previous Thread: read line from file
- Next Thread: error C2512: 'Dice' : no appropriate default constructor available
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline graph homeworkhelper iamthwee ifstream input int integer java lib linux list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






