Author Topic: First program.  (Read 5153 times)

Offline ikkesomye

  • Single posting newcomer
  • *
  • Posts: 6
First program.
« on: January 11, 2011, 12:47:14 am »
I am completely new to any programming language.  I am just sort of following this youtube video making your first C++ program and even though I have followed it step by step when I build and run nothing happens.

I'm sure you have all heard this question before I am just really lost.

This was the youtube video
http://www.youtube.com/watch?v=qkilWa5sX9Y

The website I am learning from
http://www.cprogramming.com/tutorial/lesson1.html

thanks to those willing to help me out.

Offline ikkesomye

  • Single posting newcomer
  • *
  • Posts: 6
Re: First program.
« Reply #1 on: January 11, 2011, 01:00:10 am »
#include <iostream>

using namespace std;

int main()
{
  cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
  cin.get();

  return 0;
}


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: First program.
« Reply #2 on: January 11, 2011, 01:37:52 am »
Welcome!!!
Quote
I'm sure you have all heard this question before I am just really lost.
what is your question?? Did you search the forum firstly??
we discuss only Code::blocks related question here, if you would like to discuss some programming question, I suggest you can go to some forum dedicate to that issue.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ikkesomye

  • Single posting newcomer
  • *
  • Posts: 6
Re: First program.
« Reply #3 on: January 11, 2011, 02:06:30 am »
my bad sorry.  Basically I am running and building the program and nothing is happening.  I am not getting the same command prompt hellow world! message the user in the video is getting.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: First program.
« Reply #4 on: January 11, 2011, 02:55:22 am »
en, what the exact steps did you do? also please describe your OS? C::B version? compiler version......

Quote
Basically I am running and building the program and nothing is happening.
this statement has no sense. (you just say: I have a problem which we all know)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ikkesomye

  • Single posting newcomer
  • *
  • Posts: 6
Re: First program.
« Reply #5 on: January 11, 2011, 03:10:18 am »
windows 7
codeblocks 10.05

#include <iostream>

using namespace std;

int main()
{
    cout <<"hello world";
    cin get();
    return 0;
}

clicking the button to build and run like said in video.

Nothing happens.

Offline ikkesomye

  • Single posting newcomer
  • *
  • Posts: 6
Re: First program.
« Reply #6 on: January 11, 2011, 03:30:31 am »
C++

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: First program.
« Reply #7 on: January 11, 2011, 05:34:49 am »
clicking the button to build and run like said in video.
Nothing happens.
what have you done before you click the button??
...
I don't want to see a whole tutorial to see what the step you take. ( the video takes 10 min)
I suggest you can just use the project wizard to create a simple console program, then test again.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ikkesomye

  • Single posting newcomer
  • *
  • Posts: 6
Re: First program.
« Reply #8 on: January 11, 2011, 06:30:25 am »
thanks for your help.