Results 1 to 11 of 11
  1. #1
    akimoko's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    0

    [Tutorial] Your first program

    Btw sorry if this tutorial is hard to understand its my first
    Create a new console Application (win32 is the same as a console application)

    If the following Code is not in your Starting code already then put it in

    #include <stdlib.h>
    #include <iostream.h>
    #include <string>
    using namespace std;

    int main(int main(int argc, char *argv[]))

    {
    system("PAUSE");
    return 0;
    }


    Ok now go to the first Bracket and hit enter twice to start a line under the bracket.

    then Type the following

    cout << "hello i am your computer talking" << endl;

    Now your code should look like this

    #include <stdlib.h>
    #include <iostream.h>
    #include <string>
    using namespace std;

    int main(int main(int argc, char *argv[]))

    {

    cout << "hello i am your computer talking" << endl;

    system("PAUSE");
    return 0;

    }


    Now all you have to do is Build and compile then run it and a dos window should appear saying

    "Hello , I am your computer talking"



    Summary :

    the command 'cout' tells the computer that you want to output some data through the console.

    The 2 less than sign following the cout tell the computer that the thing that follows will be shown on the console.

    The double quotes are to tell the computer where the string will start and end.

    And Endl; means that you want to start a new line.



    Hope this helped Some of you soon-to-be programmers on your way of learning, I will Be making a tutorial soon on how to make the console add,substract,multiply or divide numbers.

    -Dan

  2. #2
    Skurdz's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Posts
    162
    Reputation
    10
    Thanks
    22
    My Mood
    Bored
    where can i get a free c/c++ compiler that isnt dev-c++? it doesnt work for me...



  3. #3
    gunot's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    1,861
    Reputation
    29
    Thanks
    322
    hamm ... dont really get what this dose.. i only se a cout and it says im your cumputer talking nothing more really :S

  4. #4
    SpiderByte's Avatar
    Join Date
    Jan 2006
    Posts
    103
    Reputation
    10
    Thanks
    3
    All this for a simple "Hello Worl!" I don't think so...

  5. #5
    Joanne's Avatar
    Join Date
    Jan 2006
    Posts
    42
    Reputation
    10
    Thanks
    5
    You don't need all of that in there honestly, all you really need is a simple cout output message and then you can get it to say something. And you don't have to include those libraries just include the iostream.

    Something easy like

    Code:
    #include <iostream>
    using namespace std;
    
    int main() {
        cout << "Hello World";
        return 0;
    }
    That's as easy as it gets.. but I don't know why you did all of that extra stuff just to make it say something you don't really need to put all of that, lol.

    And that's using C++.. :/

    Course if you want to start in C you can, but I think C++ is somewhat easier, don't ask me why I thikn this but seriously, not everyone is right about starting with C.
    Last edited by Joanne; 03-31-2006 at 09:30 AM.

  6. #6
    kvmn8's Avatar
    Join Date
    Jan 2006
    Location
    PANTS
    Posts
    1,157
    Reputation
    10
    Thanks
    104
    Quote Originally Posted by SpiderByte
    All this for a simple "Hello Worl!" I don't think so...
    lolz good stuff

  7. #7
    EkstatikX's Avatar
    Join Date
    Jul 2006
    Posts
    13
    Reputation
    10
    Thanks
    0
    I replaced "hi, I'm your computer talking." with "hi, I am your ass-slave"

  8. #8
    Calard's Avatar
    Join Date
    Jun 2006
    Gender
    male
    Posts
    305
    Reputation
    13
    Thanks
    172
    Quote Originally Posted by EkstatikX
    I replaced "hi, I'm your computer talking." with "hi, I am your ass-slave"
    Fun is what programming is all about right?

  9. #9
    SadisticGrin's Avatar
    Join Date
    Jan 2006
    Gender
    male
    Location
    Behind you.
    Posts
    1,428
    Reputation
    10
    Thanks
    125
    Ok.....so I can use c++ to map out a prog like the Headshot single kill for warrock?
    [CENTER]
    The Grin is in.
    [IMG]https://i33.photobucke*****m/albums/d74/sadisticgrin/The-grincopy.png[/IMG]
    I AM the Influence.

  10. #10
    jeremy6996's Avatar
    Join Date
    Jul 2006
    Gender
    male
    Posts
    154
    Reputation
    10
    Thanks
    7
    #include <stdlib.h>
    #include <iostream.h>
    #include <string>
    using namespace std;

    int main(int main(int argc, char *argv[]))

    {

    cout << "hello i am your computer talking" << endl;

    system("PAUSE");
    return 0;

    }

    thats C/not C++ (this is C++ Section)

    C#/C++ would be more like

    #include <iostream>
    using namespace std;
    int main()
    {
    cout<<"Eny text";
    cin.get(); //if you want

  11. #11
    Naeron's Avatar
    Join Date
    Feb 2007
    Posts
    163
    Reputation
    11
    Thanks
    6
    Quote Originally Posted by Skurdz View Post
    where can i get a free c/c++ compiler that isnt dev-c++? it doesnt work for me...
    Why isnt dev-c++ working for you? I think its a great ide. I use it as well. But you can try cygwin. Its also free.

Similar Threads

  1. [RELEASE/INFO] CN Tutorial - Making your first CA Hack!
    By CoderNever in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 170
    Last Post: 07-26-2010, 09:11 AM
  2. Replies: 13
    Last Post: 12-28-2009, 01:13 AM
  3. *DLL* [Tutorial] Make Your first DLL Interacted to a Form Project...
    By Silk[H4x] in forum Visual Basic Programming
    Replies: 14
    Last Post: 06-26-2009, 08:52 PM
  4. Replies: 28
    Last Post: 03-02-2009, 07:44 AM
  5. [C++]Hello World; Your first C++ Program
    By Mr. Bond in forum Programming Tutorials
    Replies: 3
    Last Post: 02-09-2009, 08:53 AM