shattered space

Distinguished
Dec 18, 2010
26
0
18,580
0
I don't know how many questions I actually have on the subject, but I guess that we'll find out as I type this out. I have experience in C++, I did in Java but remember very little, and have dabbled in Python and Ruby. I like C++ and I have been looking at job postings at big companies to see just what I need to know. Most say experience in C/C++, so I was wondering if I should work my way up from C to C++, shouldn't be hard seeing how they have the same workings. Or should I just continue with C++ and then learn C later on? Also how much do you usually need to know before you can say that you know a programming language. I don't need any websites or book recommendations because I have books on both C and C++. So just post your comments, thanks.
 

RyQril

Honorable
May 11, 2012
41
0
10,610
7
C++ is a superset of C. As a matter of fact, C++ can run most of C code while C cannot run C++ code (cause C++ is advanced), so C++ is a High-level language while C is Mid-level language.

so continue with C++ since you have experience with it, after that you can learn C fast, you can see the differences here.
 

shattered space

Distinguished
Dec 18, 2010
26
0
18,580
0
I know that C isn't a subset of C++, but C++ is a addition to the C language correct? But should I try and implement everything I have learned in C++ over to C then continue in C, or should I just continue C++?
 

RyQril

Honorable
May 11, 2012
41
0
10,610
7
C++ is a superset of C. As a matter of fact, C++ can run most of C code while C cannot run C++ code (cause C++ is advanced), so C++ is a High-level language while C is Mid-level language.

so continue with C++ since you have experience with it, after that you can learn C fast, you can see the differences here.
 

PhilFrisbie

Distinguished
Apr 22, 2006
666
0
19,310
53

That is false, but I will not argue it here ;)

Actually, you already proved it false: You say C++ is a super-set of C, but if that were true then ALL C code could be complied with a C++ compiler. However, you already stated that "C++ can run most of C code".
 

RyQril

Honorable
May 11, 2012
41
0
10,610
7
i didn't prove any of it as false :S, C++ came form C so its a superset, as i mentioned C cant run "C++ code" not "compile" it with C++.
The C++ began as enhancements to C, first adding classes, then virtual functions, operator overloading, multiple inheritance, templates, and exception handling among other features,
so thats why C++ cant be compiled with C compiler.

EDIT: it depends on the compiler, for an example DMC is a good C compiler that will compile C++ programs, and the GCC the C++ compiler contains C compiler too.
 

PhilFrisbie

Distinguished
Apr 22, 2006
666
0
19,310
53


Yes, C++ code cannot be compiled with a C compiler, but anything other than trivial C code cannot be compiled with a C++ compiler either. In other words, take some reasonably intense C code source files, rename their extensions from .c to .cc or .C, and try to compile them as C++; you may be surprised! C++ may have begun as an extension to C, but the two languages diverged down two separate paths years ago, never to meet again :D

Also, to be pedantic, The GNU C compiler is gcc, and the GNU C++ compiler is g++, two separate compilers.
 

ASK THE COMMUNITY