Thread: Lesson1

  1. #1
    Unregistered
    Guest

    Lesson1

    Hello, I just found this site yesterday and its a good thing I din't post then cause there would of been alot of Woohoos and Heehaws.I was realy excited and still am this morning. *\Stayed up till 3:30 having fun/* Been wanting to learn programing for a number of years now. So thanks alot for putting up this site and i will try hard to be a good student. On to my 1st problem.

    I think we should learn the pause command right in lesson 1, so we can admire and study the finished work.

    I found this pause tip in the faqs and I try to omite line saying "press button"

    #include <iostream.h>
    #include <conio.h> //for "getch()"

    int main()
    {
    cout<<"I am learnig c++ \n";
    cout<<"I am using Dev-c++ to compile \n";
    cout<<"ok, ok... Hello World!\n";
    getch();
    return 0;
    }

    I get a mistake at line 9 (implicit declaration of function `int getchar(...)'
    Are we mixing c & c++ (cause of printf instead of cout) just guessing.
    Greatly appreciate your help

  2. #2
    Registered User Generator's Avatar
    Join Date
    Aug 2001
    Posts
    238

    Check this

    Hey Check this out man.

    cprogramming.com

  3. #3
    BubbleMan
    Guest

    Post I know why..

    I have Dev-C++ 4.01. I tried conio.h when I wast starting out, but got the same error. Try using #include <conio.c> instead of #include <conio.h>.

  4. #4
    Unregistered
    Guest
    tried <<endl; & <<flush; & <<endl <<flush; din't work. changing conio.h to .c worked
    Woohoo on to Lesson 2. thanks guys

  5. #5
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Its just a bad compiler

    Dev C++ just isnt a good compiler, get MSVC.

    SPH

  6. #6
    Unregistered
    Guest

    Unhappy

    I don't even have to write .h in <iostream>
    no skip line between #include and int main()
    it compiles and runs anyways. and now pauses.
    Am I learning bad habits??

  7. #7
    Registered User minime6696's Avatar
    Join Date
    Aug 2001
    Posts
    267

    Cool Now you are...

    You where doing good code, but <> with no .h is limeting and not ocmpatable with everything. You need to understand what you are working with, u seem not to have been tought a lot of the fundemental lessons in the begging. I suggest the book I started with:

    C for dummies.
    and
    Teach yourself C in 24 hours.

    Then just internet tuts and this site after that.

    I would be happy to help, SPH

Popular pages Recent additions subscribe to a feed