June 19, 2013, 04:35:59 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Prowlie Welcome back! The site migration is complete and normal service resumed.
Advanced search
Pages: [1]   Go Down
Print
Author Topic: Am trying to learn C++  (Read 1983 times)
0 Members and 1 Guest are viewing this topic.
Halowood
Veteran
*****
Offline Offline

Gender: Male
Posts: leet


Brackenwood's $8 minister


« on: March 02, 2010, 05:50:55 PM »

ok i'm trying to learn c++ from this tutorial here and I can't see what i'm doing wrong.

Code:
// Test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main()
{
std::cout << "Hello World!" << std::end1;
return 0;
}

It is the exact same as the pictures in the tutorial.
Logged


Quote
All around the stactus plant the stalker chased the bandit, stalker thought twas all in fun POP goes the bandit.
Yeah I wasn't about to let her come in here and keep that shit up. I like this forum.
Jaehl
Mobal Gloderator
Global Moderator
Veteran
***
Offline Offline

Gender: Male
Posts: 1418


/* No comment */


WWW
« Reply #1 on: March 02, 2010, 08:34:10 PM »

You seem to be missing an #include <iostream> Smiley
Logged


<a href="http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf" target="_blank">http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf</a><a href="http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf" target="_blank">http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf</a>
Sarus translator:
<a href="http://www.jaehl.com/files/progress.swf" target="_blank">http://www.jaehl.com/files/progress.swf</a>
supermoose
Full Member
***
Offline Offline

Gender: Male
Posts: 240


Yes. I beat IWBTG. Only took ~60 hours of play.


« Reply #2 on: March 03, 2010, 04:39:34 AM »

yup, that would do it.  I am also partial to

printf("hello world \n");

myself, cout<< always seemed janky to me, like it was just kind of thrown in at the last minute.
Logged

Halowood
Veteran
*****
Offline Offline

Gender: Male
Posts: leet


Brackenwood's $8 minister


« Reply #3 on: March 03, 2010, 08:47:50 AM »

I tried with the #include <iostream> and it was a no go.
Logged


Quote
All around the stactus plant the stalker chased the bandit, stalker thought twas all in fun POP goes the bandit.
Yeah I wasn't about to let her come in here and keep that shit up. I like this forum.
Jaehl
Mobal Gloderator
Global Moderator
Veteran
***
Offline Offline

Gender: Male
Posts: 1418


/* No comment */


WWW
« Reply #4 on: March 03, 2010, 09:04:29 AM »

Hmmm, So what exactly does it do? Does it compile OK?
« Last Edit: March 03, 2010, 09:09:53 AM by Jaehl » Logged


<a href="http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf" target="_blank">http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf</a><a href="http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf" target="_blank">http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf</a>
Sarus translator:
<a href="http://www.jaehl.com/files/progress.swf" target="_blank">http://www.jaehl.com/files/progress.swf</a>
supermoose
Full Member
***
Offline Offline

Gender: Male
Posts: 240


Yes. I beat IWBTG. Only took ~60 hours of play.


« Reply #5 on: March 03, 2010, 02:23:43 PM »

Also, what operating system/compiler are you trying to use?  I know that linux (what I am familiar with) and Windows can have some differing library names on occasion.
Logged

Halowood
Veteran
*****
Offline Offline

Gender: Male
Posts: leet


Brackenwood's $8 minister


« Reply #6 on: March 03, 2010, 04:06:56 PM »

I fixed it.
For some reason the #include "stdafx.h" vanished but I put that back in and it compiled.
Which is weird because that code I posted was copied and pasted straight out of Visual Studio C++ 2008.

EDIT:I just realised I somehow got this code in the working one instead.
Code:
// Test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
 
int main()
{
using namespace std;
cout << "Hello world!" << endl;
return 0;
}


EDIT:2
Now I feel like an idiot I figured out what was wrong. I had end1 instead of endl in there.
« Last Edit: March 03, 2010, 04:38:55 PM by Halowood » Logged


Quote
All around the stactus plant the stalker chased the bandit, stalker thought twas all in fun POP goes the bandit.
Yeah I wasn't about to let her come in here and keep that shit up. I like this forum.
adzy-2k6
Senior Member
****
Offline Offline

Posts: 725


« Reply #7 on: March 04, 2010, 04:20:42 AM »

You will be better off typing the code yourself rather than copying and pasting. You will get used to syntax faster that way, and since you will make a lot of errors when you start out you become much better at spotting them in these small peices of code.
Logged

Halowood
Veteran
*****
Offline Offline

Gender: Male
Posts: leet


Brackenwood's $8 minister


« Reply #8 on: March 04, 2010, 07:08:35 PM »

I meant the Code I posted in my post was copied straight out of my project.
Logged


Quote
All around the stactus plant the stalker chased the bandit, stalker thought twas all in fun POP goes the bandit.
Yeah I wasn't about to let her come in here and keep that shit up. I like this forum.
adzy-2k6
Senior Member
****
Offline Offline

Posts: 725


« Reply #9 on: March 05, 2010, 09:38:21 AM »

Ahh Tongue. Also, i tried learning C++ as a first programming language. It is honestly much easier to choose a simple language such as python, hava or actionscript, then build up in complexity. Sure, C++ lets you code for the Xbox 360 (this may not be the reason you chose it, but it was the reason i did), but it is a comparatively complex language.
« Last Edit: March 05, 2010, 09:46:22 AM by adzy-2k6 » Logged

Halowood
Veteran
*****
Offline Offline

Gender: Male
Posts: leet


Brackenwood's $8 minister


« Reply #10 on: March 05, 2010, 10:22:24 AM »

I am only planning on Learning C++ and PPC Assembly. I am going to learn other languages but these are my main interests right now.

And I did choose C++ for Xbox.
Logged


Quote
All around the stactus plant the stalker chased the bandit, stalker thought twas all in fun POP goes the bandit.
Yeah I wasn't about to let her come in here and keep that shit up. I like this forum.
supermoose
Full Member
***
Offline Offline

Gender: Male
Posts: 240


Yes. I beat IWBTG. Only took ~60 hours of play.


« Reply #11 on: March 05, 2010, 12:53:48 PM »

assembly will make you cry.  It is exceedingly simple, but stupid impossible to read.  I still cannot sit down to a MIPS32 assembly list and figure out what it does unless I have my reference sheet  sitting right in front of me.  At least with C++ you can have variable names.
Logged

Jaehl
Mobal Gloderator
Global Moderator
Veteran
***
Offline Offline

Gender: Male
Posts: 1418


/* No comment */


WWW
« Reply #12 on: March 05, 2010, 01:38:44 PM »

What do you want to learn an assembly language for? Undecided
Logged


<a href="http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf" target="_blank">http://i17.photobucket.com/albums/b90/Jaehll/Actionscript_Banner.swf</a><a href="http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf" target="_blank">http://img.photobucket.com/albums/v661/Vector88/motm.swf?vTitle=oct%2Fnov%2007.swf</a>
Sarus translator:
<a href="http://www.jaehl.com/files/progress.swf" target="_blank">http://www.jaehl.com/files/progress.swf</a>
adzy-2k6
Senior Member
****
Offline Offline

Posts: 725


« Reply #13 on: March 06, 2010, 05:13:15 AM »

You do realise that you you have to code every little detail of the game? You have to write code for animating gifs, moving objects on the screen, etc. Atleast with actionscript in flash, a lot of the stranger peices such as animation and the like is pre-coded. You would be better off coding simple games in flash then moving to consiles once you grasp the basics. If you still want to go ahead with it, i would recommend taking any Mechanical Maths so that you have an idea of the sort of maths required to calculate the physics and the like. And assembly is the stage right before writing your code in 1's and 0's. Still, i suppose i should be more encouraging, so what sort of stuff are you thinking of making for the xbox?
Logged

Halowood
Veteran
*****
Offline Offline

Gender: Male
Posts: leet


Brackenwood's $8 minister


« Reply #14 on: March 06, 2010, 11:51:10 AM »

I'm not planning on coding games just yet that's a couple years away. I want C++ at the moment so I can write software and other things in general I want PPC assemply so I can try and Stealth patch the kernal of either freeBOOT or XBReboot.
Logged


Quote
All around the stactus plant the stalker chased the bandit, stalker thought twas all in fun POP goes the bandit.
Yeah I wasn't about to let her come in here and keep that shit up. I like this forum.
Brackenwood
   

 Logged
Pages: [1]   Go Up
Print
Jump to:  

Theme by Pieter, based on Black Rain by Crip Powered by SMF 1.1.16 | SMF © 2011, Simple Machines XHTML | CSS

Page created in 0.087 seconds with 26 queries.