C++ to C?

This is a discussion on C++ to C? within the C++ Programming forums, part of the General Programming Boards category; It was my 26th yesterday! yay! Anyway, I got given a book on C programing from my uncle and at ...

  1. #1
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479

    C++ to C?

    It was my 26th yesterday! yay! Anyway, I got given a book on C programing from my uncle and at the end of the book it says this:

    Code:
    Now you have finished this book, learn more about C. It is the most powerful and muti-used language avalible.

    I am not really going to use the book as I have been learning C++ for two years now anyway. What do you think of the statement? If anything i think C++ is most efficent language to date, Not C.

    On another note, looking at two seperate samplesm you cab see why C++ is better!

    code in C:

    Code:
    #include <stdio.h>
    
    int main()
    {
    printf("Hello World");
    
    return;
    }
    I think doing the same statement in C++ looks better anyway. I wonder why the book example shown above only uses return and not return 0?

  2. #2
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    1) congrats
    2) most books say something similar about the language they teach. I've seen something like that in a VB book once (yes, I once got one from an employer who wanted me to learn it, after reading the book I told them what to do with it)
    3) define "efficient". For some definitions of efficient you may be right, for some others certainly not.
    4) this saves 2 keystrokes, much more efficient than typing "return 0;"

  3. #3
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    In some cases, working with c is a better option than c++.
    usually in systems level programming it's a c and assembler mix.
    for user space programs, c++ is more commonly used, the extra features make c++ more usefull here.

    in a kernel, or basic system tool, the fact that c doesn't have all the features of c++ makes it the better language.
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Stricly speaking, you could say that all Turing-complete languages are equally powerful. That includes even languages like Brain.........

    Practically, though, that's absurd. In reality, C and C++ are about equally powerful - but it's usually less work with C++ to achieve the same, with better reliability and fewer chances for errors.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #5
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,262
    I don't pretent to be a genius in programming, but I prefer C++ ... also your profile says your birthday is "September 4, 1980" ... is today the fifth of september?? NOOOOOOOO!!!!!!!

    I think this is the most powerful language: Best Language Ever!

    as a review: An eight instruction computer language
    haha

    EDIT:

    Unfortunately there seems to be a bad word in the url... so it's edited ....

    try:

    this

    second page, fourth hit down.
    Last edited by twomers; 02-17-2006 at 06:47 AM.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21