Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Major differences between C and C++
06-07-2011, 04:50 AM
Post: #1
Not Solved Major differences between C and C++
I am currently a 2 nd year computer science and was wondering what was the big difference betweem C and C++. I am learning C++ in school right now and that's about all I know. From looking at C code, it's seems like it uses alot of different functions for printing to the screen and taking input from the keyboard. Also from what I know C++ is object oriented and C is not. The last difference I have read about C++ is that it has alot more libarys availalbe for it (like the standard templete libary). So with all this said, is learning old school C even worth it anymore? Will I be okay in terms of editing source code for linux with my C++ knowledge?
Find all posts by this user
Quote this message in a reply
06-09-2011, 12:24 AM
Post: #2
Not Solved RE: Major differences between C and C++
You must know the programming language for which the program (in this case the linux kernel) is written in if you want to change it. Linux is written in c so why would you treat it like it is written in c++? Now I'll admit that I don't know the differences between the 2 but I'm sure that there are some. Using the incorrect language could lead to compilation and/or run time errors.

[Image: t0209.gif]
TechnoFyed Forums
Senior Staff Member

[Image: signature.php?uid=1]
Visit this user's website Find all posts by this user
Quote this message in a reply
06-09-2011, 07:25 AM (This post was last modified: 06-09-2011 08:12 AM by no2pencil.)
Post: #3
Not Solved RE: Major differences between C and C++
C++ uses classes, where as C does not. You were also correct in that C++ is an object oriented language & C by design is not. Their syntax is similar, but they are in fact different languages, just as Visual Basic & PHP are different languages. They have their similarities, but to list their differences is beyond the scope of just a simple explanation.

It's difficult to tell you if learning C is valuable or not, because I don't know what your overall goals are. It wouldn't hurt to know it.

Quote:Will I be okay in terms of editing source code for linux with my C++ knowledge?
Linux Code? That is to say code on a Linux system? C files are with extension .c & C++ are with .cpp. You will use your compiler to compile the source code file accordingly to what language it was written with

Quote:From looking at C code, it's seems like it uses alot of different functions for printing to the screen and taking input from the keyboard.
If you are using stdio.h & reading from the command prompt, then you can use the same functions for both languages. The functions cin & cout use namespaces, & therefor their syntax is different, but you can still use printf or scanf from the stdio.h header in both C & C++.

-#2pencil-

[Image: lovelinux.gif]
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2017, 03:38 AM
Post: #4
Not Solved RE: Major differences between C and C++
Let’s learn the major differences between C and C++ programming languages. C++ offers excellent object orientation programming (OOP) paradigm. Nevertheless, C is still the most widely used in software development.

This is one of the most asked question in the Computer Science courses. If you have done a computer science, information technology or related courses, chances are that you’ve faced this question asking you to explain “major differences between C and C++ programming languages”. And of course, most of you would have listed several such differences. Let’s explore this important question and make a comprehensive list of differences between C and C++
Find all posts by this user
Quote this message in a reply
05-18-2017, 03:39 AM
Post: #5
Not Solved RE: Major differences between C and C++
Let’s learn the major differences between C and C++ programming languages. C++ offers excellent object orientation programming (OOP) paradigm. Nevertheless, C is still the most widely used in software development.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)