+ Reply to Thread
Page 2 of 7
FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 64

Thread: C necessary before C++?

  1. #11
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    37
    Posts
    12,912
    Blog Entries
    57

    Re: C necessary before C++?

    Here's an example of how C++ can help you in ways C can't:
    Code:
    #include <gmpxx.h>
    #include <iostream>
    using std::cout;
    using std::cin;
    
    int main()
    {
      int num;
      cout<<"Pick the number you want to raise to a factorial: ";
      cin<<num;
      mpz_class fact=1;
      for(int j=1;j<=num;j++)
        fact*=j;
      cout<<num<<"! = "<<fact<<"\n";
      return 0;
    }
    It uses the GNU Multi-Precision library, which provides a class for arbitrarily large "integers". As a result, it is object oriented. The class is a wrapper for a collection of C functions, so you can use this library with C as well. However, just looking at the code, it appears to be a simple procedural program with a funny data type. This is the power of C++. You can create classes that simply get out of your way and let you work without thinking too much about them. The C version of this program, using the same library, is much more complicated and imposes more responsibility on the user.
    CodeCall Blog | CodeCall Wiki
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  2. #12
    Guru ArekBulski is just really nice ArekBulski is just really nice ArekBulski is just really nice ArekBulski is just really nice ArekBulski is just really nice ArekBulski's Avatar
    Join Date
    Mar 2009
    Posts
    1,379

    Re: C necessary before C++?

    Interesting elaboration, Winged. So is this topic going wider? Perhaps we could ask: should he learn assembler before C before C++ before C#?

  3. #13
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    37
    Posts
    12,912
    Blog Entries
    57

    Re: C necessary before C++?

    I'd say that C# is more of an aside to the C/C++ debate. C# borrows more from Java than from C++, though Java of course takes a lot of ideas from C++.
    CodeCall Blog | CodeCall Wiki
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #14
    Programming God outsid3r has a spectacular aura about outsid3r has a spectacular aura about outsid3r's Avatar
    Join Date
    Jul 2008
    Posts
    622

    Re: C necessary before C++?

    Quote Originally Posted by WingedPanther View Post
    I'd say that C# is more of an aside to the C/C++ debate. C# borrows more from Java than from C++, though Java of course takes a lot of ideas from C++.
    Although C++ is very different from both in my opinion.

  5. #15
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,843
    Blog Entries
    25

    Re: C necessary before C++?

    Quote Originally Posted by outsid3r View Post
    Yea, in all universities they teach C before C++ for people know the differences between programming paradigms.
    Be careful with your use of universal quantification. I am in my fourth year of university, and I've yet to learn C.

  6. #16
    Newbie Raitt is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    6

    Re: C necessary before C++?

    In our univercity C++ is studied at the first semester but education program don't give sufficient attention for C, so some students don't understand differents between this languages I think it's wrong

  7. #17
    Programming God outsid3r has a spectacular aura about outsid3r has a spectacular aura about outsid3r's Avatar
    Join Date
    Jul 2008
    Posts
    622

    Re: C necessary before C++?

    Quote Originally Posted by Raitt View Post
    In our univercity C++ is studied at the first semester but education program don't give sufficient attention for C, so some students don't understand differents between this languages I think it's wrong
    It isn't really necessary to teach C for u to understand the differences between two paradigms, there are many procedural languages like C.

  8. #18
    Programming God outsid3r has a spectacular aura about outsid3r has a spectacular aura about outsid3r's Avatar
    Join Date
    Jul 2008
    Posts
    622

    Re: C necessary before C++?

    Quote Originally Posted by John View Post
    Be careful with your use of universal quantification. I am in my fourth year of university, and I've yet to learn C.
    well, that's really very strange, what languages had you learned in university?

  9. #19
    Programming Expert Chinmoy has a spectacular aura about Chinmoy has a spectacular aura about Chinmoy's Avatar
    Join Date
    Feb 2008
    Location
    where heaven meets earth
    Posts
    411

    Re: C necessary before C++?

    definitely not. They are two different things. People are often made into believing that learning c helps before c++. I would say, do not waste your time, go for c++ straight and then come back to C just to learn the diferences in usage, there are only a few. read here :: Differences between c and c++ | TECHARRAZ
    God is real... unless declared an integer

  10. #20
    Newbie Ultma2 is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    1

    Re: C necessary before C++?

    No C is not necessary before C++. They are two different languages, you dont need to know C before learning C++

+ Reply to Thread
Page 2 of 7
FirstFirst 1 2 3 4 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)