Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33

Thread: difference between c and c++

  1. #11
    Join Date
    Jul 2006
    Beans
    Hidden!

    Re: difference between c and c++

    cout<< "please enter 3 numbers!";<< endl;

  2. #12
    Join Date
    Nov 2007
    Location
    South African in London
    Beans
    1,098
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: difference between c and c++

    Part of learning to program is learning how to debug. They go hand in hand

  3. #13
    Join Date
    Apr 2007
    Beans
    14,781

    Re: difference between c and c++

    Quote Originally Posted by limac View Post
    where was that?
    There error messages are cryptic, but the line number given is usually correct, +/- 1 line.

  4. #14
    Join Date
    Oct 2007
    Location
    USA
    Beans
    354

    Re: difference between c and c++

    Thanks for those answers they worked!!!

    And also I installed dev-c++ (bloodshed) compiler but couldn't run the file after compiling it successfully. I mean if I click on run no actions take place.

    what to do to fix that?
    Last edited by limac; December 4th, 2007 at 01:52 AM.
    Think carefully before just copying and pasting the commands your are advised into your terminal and clicking Enter, for more information about which ones not to use see this: http://ubuntuforums.org/announcement.php?f=73

  5. #15
    Join Date
    Nov 2006
    Location
    Israel
    Beans
    765
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: difference between c and c++

    Are you sure nothing happens?

    In dev-c++ the console window closes as soon as the program finished execution (main returns). Add this at the end (but before the return of course) so that the window will stay open:
    Code:
    int test;
    cin >> test;
    Intel E6300 / MSI P4M890M / 2GB DDR2 677 / 80GB + 1TB SATA2 / GeForce 6200TC / DL DVD+-RW / Dell 24" U2410

  6. #16
    Join Date
    Jan 2006
    Location
    Baltimore
    Beans
    122

    Re: difference between c and c++

    Write a getch() or a cin>> statement towards the end of your program so that the output window remains there till you can view it
    To understand recursion you must understand recursion

    http://krishnamurthy.net.in

  7. #17
    Join Date
    May 2007
    Location
    Basildon, England
    Beans
    339
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: difference between c and c++

    Quote Originally Posted by LaRoza View Post
    C is a very simple language; C++ can be confusing, but isn't complicated either.
    The old saying used to be you can learn a new programming language in 3 months but you need 6 months to learn C.
    C is very simple at certain levels. Because of it low use of reserved words and simplistic syntax you can get to grips with some of it relative easily, however to be really good does take a bit longer.
    I have seen good code and I have seen awful code.
    Good code would consist of small functions, good flow control, tight lops etc. |I used to work on the basis that if a function went over more than two screens it was probably getting too big.
    I have seen some function stretching over a 30 page listing. It is almost impossible to see how the code is controlled and is a nightmare to debug.
    So maybe the language is simple but what you do with is may not be. Ultimately you pays your money and take your choice.
    Mick 'n Keef rock, Chas beats time and Ronnie is the new boy
    Registered as user 466848 with the Linux Counter. Registered Ubuntu User 22858. Our company website or our new venture

  8. #18
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: difference between c and c++

    Learning syntax of a language is one thing. Learning idiomatic usage of language, libraries and data structures is different - and takes substantially more time.

    Catch with learning C vs C++ is: idioms are different, valid C is bad C++ and vice versa.

    Disclosure: I am not C/C++ expert but this is what real experts repeated over and over in previous discussions.

  9. #19
    Join Date
    Mar 2006
    Location
    Lisbon, Portugal
    Beans
    1,909

    Re: difference between c and c++

    BAsically they are used to implement different programming paradigms-
    My blog | Arch User | Linux user #439142 | Ubuntu user #10974
    "God is real unless you declare it as integer"

  10. #20
    Join Date
    Feb 2007
    Location
    Edinburgh, Scotland
    Beans
    391

    Re: difference between c and c++

    Code:
    cout<< "please enter 3 numbers!";<< endl;
    Edit: Ignore, already been answered above
    Today we have 15 minutes of fame, tomorrow 15 minutes of anonymity.
    My Blog | Veza - Opensource TinyURL clone with sensible URLs

Page 2 of 4 FirstFirst 1234 LastLast

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
  •