Site for Tutorial C++ !

Discussion in 'C++' started by Sayajin, Nov 29, 2004.

  1. Sayajin

    Sayajin Guest

    Sayajin, Nov 29, 2004
    #1
    1. Advertising

  2. Sayajin

    Ron Natalie Guest

    Sayajin wrote:
    > Hi,
    >
    > is this a "good" tutorial on C++ : http://www.functionx.com/cpp/index.htm
    >
    > Thanks
    >
    >

    Better than some, but still could use with some proofreading
    by someone who actually KNOWS the language. Lots of mistakes
    and misinformation in the first two chapters I read.
     
    Ron Natalie, Nov 29, 2004
    #2
    1. Advertising

  3. * Ron Natalie:
    > Sayajin wrote:
    > > Hi,
    > >
    > > is this a "good" tutorial on C++ : http://www.functionx.com/cpp/index.htm
    > >
    > > Thanks
    > >
    > >

    > Better than some, but still could use with some proofreading
    > by someone who actually KNOWS the language. Lots of mistakes
    > and misinformation in the first two chapters I read.


    From the first chapter:

    <quote>
    The libraries are (also) called header files and, as computer files,
    they have the extension ".h". An example would be house.h, or person.h.
    As you see, they could have any name; when you start creating your own
    libraries, you will give your files custom and recognizable names.

    The first library we will be interested in is called iostream. It asks
    the computer to display stuff on the monitor's screen.

    To see how to put a library in your program, you put it at the beginning
    of the file. Here is an example

    include iostream.h
    </quote>

    It's difficult to know where to begin when the author's understanding is
    so warped; I think I pass on this one...

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
     
    Alf P. Steinbach, Nov 29, 2004
    #3
  4. Sayajin

    Fabio Guest

    "Alf P. Steinbach" <> wrote in message
    news:...
    >* Ron Natalie:
    >> Sayajin wrote:
    >> > Hi,
    >> >
    >> > is this a "good" tutorial on C++ :
    >> > http://www.functionx.com/cpp/index.htm
    >> >
    >> > Thanks
    >> >
    >> >

    >> Better than some, but still could use with some proofreading
    >> by someone who actually KNOWS the language. Lots of mistakes
    >> and misinformation in the first two chapters I read.

    >
    > From the first chapter:
    >
    > <quote>
    > The libraries are (also) called header files and, as computer files,
    > they have the extension ".h". An example would be house.h, or person.h.
    > As you see, they could have any name; when you start creating your own
    > libraries, you will give your files custom and recognizable names.
    >
    > The first library we will be interested in is called iostream. It asks
    > the computer to display stuff on the monitor's screen.
    >
    > To see how to put a library in your program, you put it at the beginning
    > of the file. Here is an example
    >
    > include iostream.h
    > </quote>
    >
    > It's difficult to know where to begin when the author's understanding is
    > so warped; I think I pass on this one...
    >

    From lesson 12 - Dynamic Multi-Dimensional Arrays

    int main()
    {
    int *pNumbers[2];

    *pNumbers = new int[0]; // it allocates a vector of size 0
    (*pNumbers)[0] = 31; // core dump
    (*pNumbers)[1] = 29; // core dump
    (*pNumbers)[2] = 31; // core dump
    (*pNumbers)[3] = 30; // core dump
    (*pNumbers)[4] = 31; // core dump
    (*pNumbers)[5] = 30; // core dump

    *(pNumbers+1) = new int[1]; // it allocates a vector of size 1
    (*(pNumbers+1))[0] = 31; // we are lucky
    (*(pNumbers+1))[1] = 31; // core dump
    (*(pNumbers+1))[2] = 30; // core dump
    (*(pNumbers+1))[3] = 31; // core dump
    (*(pNumbers+1))[4] = 30; // core dump
    (*(pNumbers+1))[5] = 31; // core dump

    cout << "List of Numbers";
    cout << "\n(*pNumbers)[0] = " << (*pNumbers)[0];
    cout << "\n(*pNumbers)[1] = " << (*pNumbers)[1];
    cout << "\n(*pNumbers)[2] = " << (*pNumbers)[2];
    cout << "\n(*pNumbers)[3] = " << (*pNumbers)[3];
    cout << "\n(*pNumbers)[4] = " << (*pNumbers)[4];
    cout << "\n(*pNumbers)[5] = " << (*pNumbers)[5] << endl;

    cout << "\n(*(pNumbers+1))[0] = " << (*(pNumbers+1))[0];
    cout << "\n(*(pNumbers+1))[1] = " << (*(pNumbers+1))[1];
    cout << "\n(*(pNumbers+1))[2] = " << (*(pNumbers+1))[2];
    cout << "\n(*(pNumbers+1))[3] = " << (*(pNumbers+1))[3];
    cout << "\n(*(pNumbers+1))[4] = " << (*(pNumbers+1))[4];
    cout << "\n(*(pNumbers+1))[5] = " << (*(pNumbers+1))[5] << endl;

    delete [] *pNumbers;
    delete [] *(pNumbers+1);

    return 0;
    }

    Fabio
    Italy
     
    Fabio, Nov 29, 2004
    #4
  5. Thorsten Ottosen, Nov 29, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr Gordonz
    Replies:
    1
    Views:
    320
    SStory
    Aug 10, 2003
  2. Glendon
    Replies:
    1
    Views:
    750
    Alvin Bruney
    Nov 10, 2003
  3. Rensjuh
    Replies:
    7
    Views:
    980
    Mabden
    Sep 2, 2004
  4. W. Watson
    Replies:
    13
    Views:
    1,069
    W. Watson
    Sep 20, 2007
  5. Linuxmank
    Replies:
    36
    Views:
    1,501
    Linuxmank
    Aug 8, 2009
Loading...

Share This Page