Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Problem with c++

 
Post new topic   Reply to topic Printable version
 View previous topic  A3 Desktop Shortcuts Post :: Post another c++ question  View next topic  
Author Message
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Thu Mar 13, 2008 3:05 pm    Post subject: Problem with c++ Reply to topic Reply with quote

This is wierd but my program doesnt compile and this is what comiled log says
Code: Show/Hide
Compiler: Default compiler
Executing  g++.exe...
g++.exe "C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp" -o "C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.exe"    -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include"  -I"C:\Dev-Cpp\include\c++\3.4.2\backward"  -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32"  -I"C:\Dev-Cpp\include\c++\3.4.2"  -I"C:\Dev-Cpp\include"   -L"C:\Dev-Cpp\lib"
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp: In function `int main()':
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:22: error: no match for 'operator<<' in 'pok << p1'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:23: error: no match for 'operator<<' in 'pok << hp1'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:24: error: no match for 'operator<<' in 'pok << dmg1'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:25: error: no match for 'operator<<' in 'pok << evol1'

C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:26: error: no match for 'operator<<' in 'pok << p2'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:27: error: no match for 'operator<<' in 'pok << hp2'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:28: error: no match for 'operator<<' in 'pok << dmg2'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:29: error: no match for 'operator<<' in 'pok << evol2'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:30: error: no match for 'operator<<' in 'pok << p3'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:31: error: no match for 'operator<<' in 'pok << hp3'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:32: error: no match for 'operator<<' in 'pok << dmg3'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:33: error: no match for 'operator<<' in 'pok << evol3'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:34: error: no match for 'operator<<' in 'pok << p4'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:35: error: no match for 'operator<<' in 'pok << hp4'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:36: error: no match for 'operator<<' in 'pok << dmg4'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:37: error: no match for 'operator<<' in 'pok << evol4'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:38: error: no match for 'operator<<' in 'pok << p5'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:39: error: no match for 'operator<<' in 'pok << hp5'
C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:40: error: no match for 'operator<<' in 'pok << dmg5'

C:\Documents and Settings\Owner\Desktop\c++\Pokemon\Pokemon.cpp:41: error: no match for 'operator<<' in 'pok << evol5'

Execution terminated


here is the source code of the program
Code: Show/Hide
// pokemon legend http://iabot.iespana.es/juegos/pokemon/pokemon-rubi-zafiro.gif
#include <windows.h>
#include <stdlib.h>
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    system("bin\\font.bat");
   
    SetConsoleTitle("A3 Pokemon");
   
    char name[80];
    char p1[80],p2[80],p3[80],p4[80],p5[80],mp[80];
    int hp1,hp2,hp3,hp4,hp5,hpmp;
    int dmg1,dmg2,dmg3,dmg4,dmg5,dmgmp;
    char evol1[80],evol2[80],evol3[80],evol4[80],evol5[80],evolmp[80];
   
    ifstream pok;
    pok.open("bin\\pokemon.a3");
    pok<<p1;
    pok<<hp1;
    pok<<dmg1;
    pok<<evol1;
    pok<<p2;
    pok<<hp2;
    pok<<dmg2;
    pok<<evol2;
    pok<<p3;
    pok<<hp3;
    pok<<dmg3;
    pok<<evol3;
    pok<<p4;
    pok<<hp4;
    pok<<dmg4;
    pok<<evol4;
    pok<<p5;
    pok<<hp5;
    pok<<dmg5;
    pok<<evol5;
    pok.close();



   
    cout<<"Tyron: Welcome to A3 Pokemon world my name is Tyron, whats yours?\n";
    cout<<"Answer: ";
    cin>>name;
    cout<<"\nTyrone: Oh "<<name<<" that pussy that ran away from Danglee Sack Town..";
    cout<<"\n\tWhat ever I'm here just to give you the shitiest pokemon out there, "<<p1;
   
   
    system("pause");
   
}




by what i understand is that it says my variables like p1 p2 are underclared? but i clearly declared them
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Thu Mar 13, 2008 4:03 pm    Post subject: Reply to topic Reply with quote

No.
It's trying to tell you that there's no operator << on pok.

Are you trying to read from the file, or write to it?

I guess you are trying to read... so the operator should be >> instead of <<
_________________
It's a shark! Oh my god! Unbelievable!
Back to top
View users profile Send private message Add User to Ignore List
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Thu Mar 13, 2008 5:10 pm    Post subject: Reply to topic Reply with quote

f*ck im retarted thanks you very much i was playing around so much trying to fix it, and your right i was trying to read from file thank you very much biggrin.gif
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Thu Mar 13, 2008 7:00 pm    Post subject: Reply to topic Reply with quote

you may want to look into structs but that is more advanced.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Bak
?ls -s
0 in


Age:24
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Thu Mar 13, 2008 8:23 pm    Post subject: Reply to topic Reply with quote

after you open a file check if it opened correctly ("if (pok.good())"), otherwise your program will crash if the file doesn't exist.
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
hellzlaker
Registered Cap Buster
Popping men in the ass since Oct 2005


Gender: NEVER ENOUGH!
Joined: Oct 27 2005
Posts: 34
Offline

PostPosted: Fri Mar 14, 2008 2:18 pm    Post subject: Reply to topic Reply with quote

Bak i did something different
Code: Show/Hide
    if (!pok)
    {
             cout<<"Game files are corrupt please go to www.a3studio.4t.com and redownload pokemon game\n";
             system("pause");
             return 0;
    }


Works fine
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 658 page(s) served in previous 5 minutes.

phpBB Created this page in 0.398220 seconds : 31 queries executed (92.6%): GZIP compression disabled