C++ help.

Avatar image for sexytoad
SexyToad

2936

Forum Posts

3297

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By SexyToad

I'm so confused. I bought two books, I bought beginning c++ through game designing and C++ Primer Plus. I'm reading through them and trying some of the stuff out but I can't even get a screen to come up to say a word. Both of the books start with being able to make a word or sentences pop up. I typed the code exactly how it said to. But then my IDE program saids I'm missing iostream. Both of the book saids to type #include iostream. Edit: My phone is creating typos, here's the page since I'm on my phone.

Avatar image for ssully
SSully

5753

Forum Posts

315

Wiki Points

0

Followers

Reviews: 0

User Lists: 3

#2  Edited By SSully

Copy and paste your code here please.

Avatar image for wickedfather
WickedFather

1694

Forum Posts

7

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#3  Edited By WickedFather

Have you done either of these at the top? If not then do it.

#include <iostream>

#include <iostream.h>

Avatar image for dagbiker
Dagbiker

7057

Forum Posts

1019

Wiki Points

0

Followers

Reviews: 0

User Lists: 16

#4  Edited By Dagbiker

I have no idea how to help you because your parigraph was nonsense.

But it sounds like you need to #include iosstream

Your missing a link in your compiler, thats what it sounds like.

Avatar image for amtiskaw
Amtiskaw

62

Forum Posts

5

Wiki Points

0

Followers

Reviews: 0

User Lists: 2

#5  Edited By Amtiskaw

It's iostream (short for input/output stream), not iosstream. Just adding

#include <iostream>

to the top should work.

Avatar image for ssully
SSully

5753

Forum Posts

315

Wiki Points

0

Followers

Reviews: 0

User Lists: 3

#6  Edited By SSully

@Dagbiker said:

I have no idea how to help you because your parigraph was nonsense.

But it sounds like you need to #include iosstream

Your missing a link in your compiler, thats what it sounds like.

It actually wasn't nonsense. Some bad grammar, but nothing to put the guy down about.

Avatar image for dagbiker
Dagbiker

7057

Forum Posts

1019

Wiki Points

0

Followers

Reviews: 0

User Lists: 16

#7  Edited By Dagbiker

@SSully said:

@Dagbiker said:

I have no idea how to help you because your parigraph was nonsense.

But it sounds like you need to #include iosstream

Your missing a link in your compiler, thats what it sounds like.

It actually wasn't nonsense. Some bad grammar, but nothing to put the guy down about.

Your right.

Avatar image for mc_hify
MC_Hify

392

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#8  Edited By MC_Hify

@Dagbiker said:

@SSully said:

@Dagbiker said:

I have no idea how to help you because your parigraph was nonsense.

But it sounds like you need to #include iosstream

Your missing a link in your compiler, thats what it sounds like.

It actually wasn't nonsense. Some bad grammar, but nothing to put the guy down about.

Your right.

http://instantrimshot.com/

Avatar image for echofoxz
Echofoxz

106

Forum Posts

58

Wiki Points

0

Followers

Reviews: 1

User Lists: 2

#9  Edited By Echofoxz

<iostream> is the library you will be using in your program, which includes cout, cin, etc.

There are other libraries you can use, such as <cmath>, <vector>, <fstream>, those are just the basic ones, there are a lot more.

Avatar image for sexytoad
SexyToad

2936

Forum Posts

3297

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#10  Edited By SexyToad

There fixed the typos and grammar issues, also added the code.

Avatar image for renahzor
Renahzor

1043

Forum Posts

386

Wiki Points

0

Followers

Reviews: 3

User Lists: 3

#11  Edited By Renahzor

@SexyToad: What program/compiler are you writing your code in? If you copy paste that code directly it should work unless you have some setup issues in whatever compiler you're running (or say, picked a wrong project type in visual C++ etc).

Avatar image for ollyoxenfree
OllyOxenFree

5015

Forum Posts

19

Wiki Points

0

Followers

Reviews: 0

User Lists: 9

#12  Edited By OllyOxenFree
@Dagbiker said:

@SSully said:

@Dagbiker said:

I have no idea how to help you because your parigraph was nonsense.

But it sounds like you need to #include iosstream

Your missing a link in your compiler, thats what it sounds like.

It actually wasn't nonsense. Some bad grammar, but nothing to put the guy down about.

Your right.

Tee hee.
Avatar image for yami4ct
yami4ct

187

Forum Posts

1083

Wiki Points

0

Followers

Reviews: 0

User Lists: 11

#13  Edited By yami4ct

Are you using #include <iostream> or #include <iostream.h>? If you aren't using .h, I believe you need to do a "using namespace std;" (without the quotes of course) in your header for the code to work.

Avatar image for amtiskaw
Amtiskaw

62

Forum Posts

5

Wiki Points

0

Followers

Reviews: 0

User Lists: 2

#14  Edited By Amtiskaw

@yami4ct: <iostream.h> is deprecated and 'using namespace std;' is only needed if you don't want to write 'std::cout', 'std::cin', ... all the time, and just write 'cout', 'cin', ...

Avatar image for butano
butano

2001

Forum Posts

60

Wiki Points

0

Followers

Reviews: 1

User Lists: 7

#15  Edited By butano

Some compilers can be really finicky when it comes to header files. Have you tried #include <iostream.h>? Sometimes they need that .h at the end just to be sure.

Avatar image for renahzor
Renahzor

1043

Forum Posts

386

Wiki Points

0

Followers

Reviews: 3

User Lists: 3

#16  Edited By Renahzor

@yami4ct: He doesn't need to declare namespace std since that code identifies each namespace for the components that need it (std::cout). His compiler is not finding iostream at all, so its likely just an issue with where his IDE is pointing to try and find those files.

Avatar image for yami4ct
yami4ct

187

Forum Posts

1083

Wiki Points

0

Followers

Reviews: 0

User Lists: 11

#17  Edited By yami4ct

@Amtiskaw: Ahhh. Thanks for pointing that out. I was never taught the long way, so that went right over my head. You learn something new every day.

Avatar image for equitasinvictus
EquitasInvictus

2080

Forum Posts

1478

Wiki Points

0

Followers

Reviews: 1

User Lists: 1

#18  Edited By EquitasInvictus

@SexyToad: Which IDE are you using? If you're still having a problem, you might just have to switch IDEs. A lot of people will say "don't use an IDE period," but if you're just starting out it's understandably tough to figure it out without having an IDE backing you up. I, for one, started using Windows' Visual C++ before I really got into compiling straight-up on Linux via the GCC compiler.

Avatar image for sexytoad
SexyToad

2936

Forum Posts

3297

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#19  Edited By SexyToad

My IDE is making a .cbp format. I need a .cpp format, right? What project am I to click on when I start. I'm trying console application but that's not making the correct format.

Avatar image for equitasinvictus
EquitasInvictus

2080

Forum Posts

1478

Wiki Points

0

Followers

Reviews: 1

User Lists: 1

#20  Edited By EquitasInvictus

@SexyToad: Yeah I don't remember ever seeing .cbp before, it must be specific to the IDE you're using.

Most compilers I've encountered will only compile C++ as (.cpp or .h if it's a header, or some variation of c's, p's, h's and x's.)

Avatar image for alianthaberries
AlianthaBerries

158

Forum Posts

479

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#21  Edited By AlianthaBerries
@Renahzor What?! Copy/Paste is unforgivable for anyone who isn't a professional. Don't even suggest it.
Avatar image for renahzor
Renahzor

1043

Forum Posts

386

Wiki Points

0

Followers

Reviews: 3

User Lists: 3

#22  Edited By Renahzor

@AlianthaBerries: I meant it in a figurative manner! ;) regardless his issue is now fixed through PMs, picked a wrong option in his IDE probably making it a .c file, which doesn't recognize iostream.

Avatar image for sexytoad
SexyToad

2936

Forum Posts

3297

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#23  Edited By SexyToad

Okay I got it working, the project I was choosing wasnt the correct one and .cbp is just the ide format. Thank you to ones who actually tried helping. Renahzor helped me figured it out.

Avatar image for amtiskaw
Amtiskaw

62

Forum Posts

5

Wiki Points

0

Followers

Reviews: 0

User Lists: 2

#24  Edited By Amtiskaw

It sounds like you're using Code::Blocks. The .cbp file is just a file that stores compiler settings and a list of the files in your project. Console application is the correct project type so that shouldn't be the problem.

When you installed your IDE, did you use codeblocks-10.05-setup.exe or codeblocks-10.05mingw-setup.exe?

Edit: whoops, didn't see the posts on the second page, so just disregard this post.

Avatar image for dexter_morgan_
Dexter_Morgan_

317

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#25  Edited By Dexter_Morgan_

How sexy.