Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I had some C background back in the university, however, I have been programming in java for 2 years and most of the C stuff were left behind.

Now I need to prepare for a test about C/C++, I doubt that I can go right into it with only some remnant of C knowledge. What could they possible cover in the test?

share|improve this question

closed as not constructive by gnat, BЈовић, Blrfl, Walter, Yusubov Sep 25 '12 at 12:11

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Is it C, or C++? They are two completely different languages. –  Daniel B Sep 25 '12 at 6:59
From the information, it said C/C++..... –  lamwaiman1988 Sep 25 '12 at 7:00
that's unfortunate; my guess is they would lean towards C++ then. I'd try to find out some more information, because C++ is one of the largest language specifications, and you're going to have trouble spot-learning it. Perhaps someone can provide an educated guess, in my experience they normally focus on template-metaprogramming, OO concepts, and relevant C++ idoms like RAII. –  Daniel B Sep 25 '12 at 7:07
@DanielB Unfortunately, people who write C/C++ usually use C++ as C with classes, and nothing else (RAII, exceptions, etc) –  BЈовић Sep 25 '12 at 8:45

3 Answers 3

C++ has different (object oriented) approach compared to C (procedural). I think you should start with some general principles about OO programming and then see how they are implemented in C++. To be more specific:

  • Data encapsulation - classes in C++ (public and private members).
  • Polymorphism - inheritance, virtual functions, etc.
  • Template classes and functions.
  • You'll figure the rest :)

I can suggest cplusplus.com as a starting point. There are some decent tutorials.

share|improve this answer
C++ is not just OOP. Thinking to C++ in therm of OOP paradigm only makes you run in pre C++03 style, and makes all the standard library incomprehensible. (there no OOP in there ... at least not "classical OOP"). The today validity of cplusplus.com is somehow questionable. They are very late in updating to the evolution the language had in the last 5 years. –  Emilio Garavaglia Sep 25 '12 at 11:19
I agree, but I don't believe this is the right approach for the current case. "I need to prepare for a test about C/C++" is not like "I want to really start learning C++". Considering this I think the point was to cover the basics in short time. Thinking generally, I agree with your comment and will upvote it as good remark! –  tsv.dimitrov Sep 25 '12 at 14:11

Common C++ things-to-know:

These two sites:

answer almost everything, but only in as much depth as you probably need to know.

This is also a good read to remind yourself to not get too object-orienty (unless this compay is into "modern" C++, which is probably the case, so interpret this as you will).

Templates are also important and neat to learn. Check out the flexibility they offer over Java generics. Some teams like to use them as frequently, or infrequently as possible. You should ask them. The rest of the OO concepts will easily carry over from Java.

Special C++ things about classes:

  • Access specifiers for inheritance (public, private, etc.)
  • Interfaces are roughly equivalent to multiply-inherited pure abstract base classes
share|improve this answer
  • abstract base classes
  • different kinds of inheritance
  • multiple inheritance
  • friend functions
  • templates
  • also, check out some implementation related details like vtables
  • may be STL: containers, algorithms, etc.
share|improve this answer
may be STL ?!?!? It's paer of the language specification. C++ without it is not C++, just C with classes! –  Emilio Garavaglia Sep 25 '12 at 11:22
@EmilioGaravaglia now you underestimate the differences between the languages themselves. "classes" is not everything. –  Mr Lister Sep 25 '12 at 11:42
@MrLister: ????????? please reparse my comment! I vever said that! –  Emilio Garavaglia Sep 25 '12 at 11:53
@EmilioGaravaglia you said C++ is "just C with classes". –  Mr Lister Sep 25 '12 at 12:23
NO. REPARSE my comment: I said C++ WITHOUT IT (the STL) is ... and frankly, your nitpicking makes no sense in this context, and adds no value (it is obvious that some diffidence in syntax is required to support classes porpoerly ...) Is it that difficult for a programmer to recognise and understand a proof-by-absurd? –  Emilio Garavaglia Sep 25 '12 at 12:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.