Results 1 to 7 of 7

Thread: What is the difference between C and C++?

  1. #1
    Join Date
    Jun 2009
    Posts
    413

    What is the difference between C and C++?

    Hello all, I am learning programming languages, I have started with C and next in the Syllabus is C++. But i don't know what is the difference between them, can anyone explain me What is the difference between C and C++? Thanks in advance...

  2. #2
    Join Date
    Jan 2009
    Posts
    1,738

    Re: What is the difference between C and C++?

    C++ is a programming language based on obkect oriented model [not a complete object oriented programming language]. While C is a procedural programming language, C emphasizes more on procedure rather then data, while C++ is data emphasized... There are a lot of more difference, its better you refer book on it...

  3. #3
    Join Date
    May 2008
    Posts
    4,085

    Re: What is the difference between C and C++?

    Undeclared functions in c++ are not allowed. The function has to have a prototype defined before the main() before use in c++ although in c the functions can be declared at the point of use.

  4. #4
    Join Date
    Jan 2009
    Posts
    202

    Re: What is the difference between C and C++?

    In C++ identifiers are not allowed to contain two or more consecutive underscores in any position. C identifiers cannot start with two or more consecutive underscores, but may contain them in other positions. C input/output is based on library and the processes are carried out by including functions. C++ i/o is made through console commands cin and cout. C does not have any classes or objects. It is procedure and function driven. There is no concept of access through objects and structures are the only place where there is a access through a compacted variable. c++ is object oriented.

  5. #5
    Join Date
    Jan 2009
    Posts
    140

    Re: What is the difference between C and C++?

    C structures have a different behaviour compared to c++ structures. Structures in c do not accept functions as their parts. C functions do not support overloading. Operator overloading is a process in which the same function has two or more different behaviours based on the data input by the user. C does not support new or delete commands. The memory operations to free or allocate memory in c are carried out by malloc() and free().

  6. #6
    Addam Guest

    Re: What is the difference between C and C++?

    * C does not have any classes or objects. It is procedure and function driven. There is no concept of access through objects and structures are the only place where there is a access through a compacted variable. c++ is object oriented.
    * C structures have a different behaviour compared to c++ structures. Structures in c do not accept functions as their parts.
    * C input/output is based on library and the processes are carried out by including functions. C++ i/o is made through console commands cin and cout.
    * C functions do not support overloading. Operator overloading is a process in which the same function has two or more different behaviours based on the data input by the user.
    * C does not support new or delete commands. The memory operations to free or allocate memory in c are carried out by malloc() and free().
    * Undeclared functions in c++ are not allowed. The function has to have a prototype defined before the main() before use in c++ although in c the functions can be declared at the point of use.
    * After declaring structures and enumerators in c we cannot declare the variable for the structure right after the end of the structure as in c++.
    * For an int main() in c++ we may not write a return statement but the return is mandatory in c if we are using int main().
    * In C++ identifiers are not allowed to contain two or more consecutive underscores in any position. C identifiers cannot start with two or more consecutive underscores, but may contain them in other positions.
    * C has a top down approach whereas c++ has a bottom up approach.
    * In c a character constant is automatically elevated to an integer whereas in c++ this is not the case.
    * In c declaring the global variable several times is allowed but this is not allowed in c++.

  7. #7
    pihu Guest

    Re: What is the difference between C and C++?

    Actually c is a procedural programming language which cann't face the real world problem. It has some drawback like a global data is shared by all function and if in a large program it is find out difficult that which function uses which data.

    On the other hand c++ is an object oriented programming language which eliminate some pitfall of conventional or procedural programming language. It is a concept or approach for designing a new software. It is nothing to do with any programming language although a programming language which support the oops concept to make it easier to implement.

Similar Threads

  1. What is difference between RAM and ROM?
    By Harper 21 in forum Motherboard Processor & RAM
    Replies: 5
    Last Post: 30-01-2010, 09:00 AM
  2. Difference between OOP and AOP
    By Sarfaraj Khan in forum Software Development
    Replies: 5
    Last Post: 20-01-2010, 09:20 AM
  3. Difference between jsp and asp.net
    By Crespin in forum Software Development
    Replies: 3
    Last Post: 24-11-2009, 06:57 AM
  4. Difference between wap and wep
    By Soggy Bottom in forum Networking & Security
    Replies: 3
    Last Post: 23-11-2009, 09:34 AM
  5. Difference between IDE and ATA
    By LALETTE in forum Hardware Peripherals
    Replies: 3
    Last Post: 09-01-2009, 10:34 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,034,396.38903 seconds with 16 queries