FAQ  •  Login

Help on C++

<<

Craziestdan

Warrant Officer 1
Warrant Officer 1

Posts: 1043

Joined: Wed Mar 26, 2008 2:36 pm

Post Wed Jun 11, 2008 1:53 pm

Help on C++

Hey
I recently tried learning some C++ tutorials, and it said they were for 100%newbies.
Being me, and then im reading along. I get to a point, where its now gunna tell me how to write my first program, which is the hello world one, where you run the exe and the 2 words 'hello world' appear on screen. So it says, right, type this into your compiler.....

Then im like, woah, what makes you think i have a compiler and know how to use them. It strangely dosnt say, it just figures, hey dan, your a newbi, you have no skills in code. thats why were assuming you know how to compile code lol.

Well i dont. I downloaded a recommened one which was visual C++ express edition. Then install it. Then i launch it, and it looks like the picture below. I have no clue where/how to compile the code. In the screen below, it just looks like something like steam, it has community news pages etc. And i cant figure out where to compile. Can someone please give me a brief on where to do so, someone who knows how **cough** **cough** **vecima** cough**


Image
Image

Thanks :t3razz:
<<

vecima

User avatar

Type 3
Type 3

Posts: 2409

Joined: Sun Jun 24, 2007 7:32 pm

Location: New Jersey

Post Wed Jun 11, 2008 2:49 pm

Re: Help on C++

THE TUTORIAL IS A LIE!!!!

jk... it's probably a good tut, but you don't actually type things into a "compiler". you write code in the IDE (Integrated Development Environment) which has basically a text editor (where you write your code) and a compiler (that changes your text into machine language).

I've never actually done a "Hello World" program in express... i did my first one in the older Visual Studio 6.

at any rate, from where you are in that screenshot, you can start off by doing something like File -> new project (or maybe new solution)...i'm not exactly sure what you're going to need to do after that... probably define a hello_world.cpp or something...

sorry... it's been a long time since i've used C++, let alone C++ with VS express... i should be able to figure it out, but i don't have VS at work, but i have express at home... perhaps i can help you out a bit later.
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Sat Oct 25, 2008 2:59 am

Re: Help on C++

From the shot it looks like you havnt actually got a solution opened.

Once you have a solution (Project) opened its fairly straight forward...

The menu items at the top change giving you:
File
Edit
View
Project
Build
Debug
Tools
Test
Window
Help

So its just a case of selecting build (Ctrl+Shift+b) and then Build Solution, Or if you want to debug first just press "F5".

Hope that helps
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

Kenny

User avatar

Warrant Officer 1
Warrant Officer 1

Posts: 1016

Joined: Sun Mar 16, 2008 3:43 am

Post Sat Oct 25, 2008 12:33 pm

Re: Help on C++

#include <stdio.h>

int main (void)
{
// local definitions

printf(" Hello World! I'm {SF} Kenny, the maker of Five! I rule the world now!");

// statements

return 1;
}
Image
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Sat Oct 25, 2008 5:22 pm

Re: Help on C++

Kenny why not use

#include <iostream.h>

main()
{
cout << "I Am Joff and I hate C++";
return 0;
}
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

Craziestdan

Warrant Officer 1
Warrant Officer 1

Posts: 1043

Joined: Wed Mar 26, 2008 2:36 pm

Post Sun Oct 26, 2008 10:40 am

Re: Help on C++

This thread is actually very old, I already figured it ^_^

And Kenny, where in the world did you get suggested:
#include <stdio.h>

int main (void)
{
printf(" Hello World! I'm {SF} Kenny, the maker of Five! I rule the world now!");
return 1;
}

As a helloworld-type code? If your tutorial is teaching you that as your first lesson, then seriously...
Your tutorial should of shown it to you like Joff posted, (but probably with using namespace std;).
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Sun Oct 26, 2008 10:49 am

Re: Help on C++

always remember to include your resources i have forgotten so many times, its probably about 50% of all cpp errors
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

Kenny

User avatar

Warrant Officer 1
Warrant Officer 1

Posts: 1016

Joined: Sun Mar 16, 2008 3:43 am

Post Sun Oct 26, 2008 3:13 pm

Re: Help on C++

That was the class I'm taking actually. It's moving a bit fast for me O.o
(Actually it's just a standard C class, not cpp.)
Last edited by Kenny on Sun Oct 26, 2008 7:52 pm, edited 1 time in total.
Image
<<

joff

User avatar

First Sergeant
First Sergeant

Posts: 787

Joined: Sat Oct 25, 2008 2:44 am

Location: Reading / UK

Post Sun Oct 26, 2008 6:28 pm

Re: Help on C++

cout is better than printf
Programmer / Web Designer / Server Admin
www.joffcom.net
www.pontification.net
<<

Craziestdan

Warrant Officer 1
Warrant Officer 1

Posts: 1043

Joined: Wed Mar 26, 2008 2:36 pm

Post Sun Oct 26, 2008 8:19 pm

Re: Help on C++

Kenny wrote:That was the class I'm taking actually. It's moving a bit fast for me O.o
(Actually it's just a standard C class, not cpp.)


If your class is going too fast, and you ever need some catching up, or reference, go herE: http://www.cplusplus.com/ that's not C tho, it's C++.
Next

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.