GuitarZone.com FORUM: programming issue... - GuitarZone.com FORUM

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

programming issue... programming 101 (stupid mistake..) Rate Topic: -----

#1 User is offline   circuspeanuts Icon

  • Group: Member
  • Posts: 485
  • Joined: 12-November 07
  • Gender:Male
  • Location:WI, USA

Posted 11 July 2008 - 08:22 PM

CODE
#include <iostream>
#include <string>
using namespace std;

class Flag {

private:
    string *FlagColorOne;
    string *FlagColorTwo;

public:
    Flag();
    SetFlagColors();
    GetFlagColors();
    ~Flag();

}



so this is my code, and it keeps on telling me that it has an 'unexpected end of file error'

...

it used to be:

CODE
#include <iostream>
#include <string>
using namespace std;

class Flag {

private:
    string *FlagColorOne;
    string *FlagColorTwo;

public:
    Flag();
    SetFlagColors();
    GetFlagColors();
    ~Flag();

protected:

}



I took out the protected part, and I tried taking out the closing bracket, but I still have the same error...and programming gurus' help me?
"circuspeanuts has the best sig I have seen in a long time." - the_lunatics_are_on_the_grass
"Best sig ever." - gusdotcom
"ahaahaha.......ure sig is hilarious....haaaaha......awesome.......PEAC EOUT" - waz416
"You deserve a paw of approval for that sig circuspeanuts " - Imme

0

#2 User is offline   Captain_Trips Icon

  • it was fun, while it lasted
  • Group: Validating
  • Posts: 24,000
  • Joined: 24-November 05
  • Gender:Male

Posted 11 July 2008 - 08:23 PM

there is a forum for this sort of thing, you know. unless you want this thread filled with spam.
Everybody's bragging and drinking that wine
I can tell the Queen of Diamonds by the way she shine
Come to Daddy on an inside straight
I got no chance of losing this time
No, I got no chance of losing this time
0

#3 User is offline   circuspeanuts Icon

  • Group: Member
  • Posts: 485
  • Joined: 12-November 07
  • Gender:Male
  • Location:WI, USA

Posted 11 July 2008 - 08:25 PM

well I figured that not everyone goes in that area, and that people here may know it as well?
"circuspeanuts has the best sig I have seen in a long time." - the_lunatics_are_on_the_grass
"Best sig ever." - gusdotcom
"ahaahaha.......ure sig is hilarious....haaaaha......awesome.......PEAC EOUT" - waz416
"You deserve a paw of approval for that sig circuspeanuts " - Imme

0

#4 User is offline   Captain_Trips Icon

  • it was fun, while it lasted
  • Group: Validating
  • Posts: 24,000
  • Joined: 24-November 05
  • Gender:Male

Posted 11 July 2008 - 08:27 PM

they very well may, but the spam will make it harder to get to the good information.

This post has been edited by Captain_Trips: 11 July 2008 - 08:27 PM

Everybody's bragging and drinking that wine
I can tell the Queen of Diamonds by the way she shine
Come to Daddy on an inside straight
I got no chance of losing this time
No, I got no chance of losing this time
0

#5 User is offline   circuspeanuts Icon

  • Group: Member
  • Posts: 485
  • Joined: 12-November 07
  • Gender:Male
  • Location:WI, USA

Posted 11 July 2008 - 08:30 PM

yes well it's posted there as well, and I haven't gotten any responses...it's late for an assignment, but I've been trying to figure this out myself....I don't understand some of it, and thus I turn to you helpful bunch because you guys have always been able to help me with this kind of stuff before, so...since I've seen you post in the hardware/software problems area, help me out?
"circuspeanuts has the best sig I have seen in a long time." - the_lunatics_are_on_the_grass
"Best sig ever." - gusdotcom
"ahaahaha.......ure sig is hilarious....haaaaha......awesome.......PEAC EOUT" - waz416
"You deserve a paw of approval for that sig circuspeanuts " - Imme

0

#6 User is offline   Captain_Trips Icon

  • it was fun, while it lasted
  • Group: Validating
  • Posts: 24,000
  • Joined: 24-November 05
  • Gender:Male

Posted 11 July 2008 - 08:31 PM

I really would if I could but I dont know programming at all. I am good with computers and peripherals and software . . . . but not programming. Sorry.
Everybody's bragging and drinking that wine
I can tell the Queen of Diamonds by the way she shine
Come to Daddy on an inside straight
I got no chance of losing this time
No, I got no chance of losing this time
0

#7 User is offline   narad1986 Icon

  • narad1986
  • Group: GZ Regular
  • Posts: 2,987
  • Joined: 15-March 03
  • Location:West Indies

Posted 11 July 2008 - 08:52 PM

QUOTE
#include <iostream>
#include <string>
using namespace std;




ahhh.....C++ .... it's been a long long time....can't help you ....

What I really wanted to say was, I read your name as "Circuspenis" ... laugh.gif laugh.gif laugh.gif
user posted image wheeeeeeeeeeeeee !
user posted image
0

#8 User is offline   circuspeanuts Icon

  • Group: Member
  • Posts: 485
  • Joined: 12-November 07
  • Gender:Male
  • Location:WI, USA

Posted 11 July 2008 - 08:57 PM

I really need help with this...
"circuspeanuts has the best sig I have seen in a long time." - the_lunatics_are_on_the_grass
"Best sig ever." - gusdotcom
"ahaahaha.......ure sig is hilarious....haaaaha......awesome.......PEAC EOUT" - waz416
"You deserve a paw of approval for that sig circuspeanuts " - Imme

0

#9 User is offline   narad1986 Icon

  • narad1986
  • Group: GZ Regular
  • Posts: 2,987
  • Joined: 15-March 03
  • Location:West Indies

Posted 11 July 2008 - 09:07 PM

Sorry man ....I did like...a kiddy course in this some years ago ........ All i could tell you is to make sure your brackets and semicolons are in order ......and yours looks ok ....

"return 0;" ? lol ..
user posted image wheeeeeeeeeeeeee !
user posted image
0

#10 User is offline   circuspeanuts Icon

  • Group: Member
  • Posts: 485
  • Joined: 12-November 07
  • Gender:Male
  • Location:WI, USA

Posted 11 July 2008 - 09:12 PM

I didn't define it...


ok so I've defined it and now my code looks like:

CODE
#include <iostream>
#include <string>
#ifndef cFlag_H
#define cFlag_H
using namespace std;

class cFlag {

private:
    string *FlagColorOne;
    string *FlagColorTwo;

public:
    cFlag();
    SetFlagColors();
    GetFlagColors();
    ~cFlag();

}; #endif;



and I get the following errors:

QUOTE
error C2014: preprocessor command must start as first nonwhite space


QUOTE
mismatched #if/#endif pair in file 'C:\Documents and Settings\Administrator\Desktop\Unit 2 my name\Flag.cpp'

This post has been edited by circuspeanuts: 11 July 2008 - 09:16 PM

"circuspeanuts has the best sig I have seen in a long time." - the_lunatics_are_on_the_grass
"Best sig ever." - gusdotcom
"ahaahaha.......ure sig is hilarious....haaaaha......awesome.......PEAC EOUT" - waz416
"You deserve a paw of approval for that sig circuspeanuts " - Imme

0

#11 User is offline   imme Icon

  • Group: GZ Regular
  • Posts: 12,798
  • Joined: 30-May 02
  • Gender:Male
  • Location:Wisconsin - backasswards and fighting change!!

Posted 12 July 2008 - 09:30 AM

Your ifndef and def flag_h should be in your Flag.h, not in your .cpp
Once it's defined, when it is called, it will remain defined

Awarded to Imme for outstanding dedication to Fine Signatures:

"Aren't you past the age where people have sex anyway? You're in your 40's, after all" - circuspeanuts
"You must have forgotten that we bought you ear plugs?" - Imme
"Yeeeaaahhh weelll, they didn't work very well" - circuspeanuts
0

#12 User is offline   circuspeanuts Icon

  • Group: Member
  • Posts: 485
  • Joined: 12-November 07
  • Gender:Male
  • Location:WI, USA

Posted 12 July 2008 - 09:52 AM

we're supposed to write it all in one area BEFORE we separate it up into separate headers and whatnot, so I'm doing what I'm told. That's not the problem though, now I'm back at the unexpected end of file error.
"circuspeanuts has the best sig I have seen in a long time." - the_lunatics_are_on_the_grass
"Best sig ever." - gusdotcom
"ahaahaha.......ure sig is hilarious....haaaaha......awesome.......PEAC EOUT" - waz416
"You deserve a paw of approval for that sig circuspeanuts " - Imme

0

#13 User is offline   imme Icon

  • Group: GZ Regular
  • Posts: 12,798
  • Joined: 30-May 02
  • Gender:Male
  • Location:Wisconsin - backasswards and fighting change!!

Posted 12 July 2008 - 09:57 AM

ok then, that may explain some of my difficulties in that class....I tend to design the whole instead of doing it all in main and trying to divvy it up...I figure it'll work if it's right either way

Awarded to Imme for outstanding dedication to Fine Signatures:

"Aren't you past the age where people have sex anyway? You're in your 40's, after all" - circuspeanuts
"You must have forgotten that we bought you ear plugs?" - Imme
"Yeeeaaahhh weelll, they didn't work very well" - circuspeanuts
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users