Advertisement

Code Compiles fine but output is bad

Started by March 01, 2001 03:18 PM
2 comments, last by SD 23 years, 11 months ago
Going a bit old school here with a dos program but the theory behind should be alright... anyway heres the code...

#include 
#include 
#include 
#include 

//using namespace std; 	

struct MapType{
int rows, columns;
string name;
int totalTiles;
int temp[36]; 
int textures [36];
};

MapType Pirafe;
MapType CurrentArea;

ifstream mapin;

int counter=0,
	counter2=0,
	i=0;

void main( void )
{
Pirafe.name="Pirafe";
CurrentArea=Pirafe;
mapin.open (CurrentArea.name.c_str ());	
mapin>>CurrentArea.rows>>CurrentArea.columns;
cout<>CurrentArea.temp;
	i++; counter++;
	}
counter=0;i=0;


while (counter=CurrentArea.temp;
		counter2++; i++;
		}
	counter2=0; i=0;
	counter++;
	}


cout<<endl;   //Outputs Array To Screen
counter=0;i=0;counter2=0;
while (counter2<CurrentArea.totalTiles)
	{
	cout<<CurrentArea.textures;
	counter2++; i++;
	}
cout<<endl<<CurrentArea.textures[0];
Pirafe=CurrentArea;
}//End Program
 </pre> 
while inside the file "pirafe" lies this info 
<pre>
6 6
1 2 3 4 5 6 
1 2 3 4 5 6
1 2 3 4 5 6
1 2 3 4 5 6
1 2 3 4 5 6
1 2 3 4 5 6
 </pre> 
this is just the rows/columns followed by numbers for the array..

the output is :
6
6
123456000000000000000000000000000000
1

the 0's are supposed to be the numbers..what's wrong????    </i>     

S.D.

Edited by - SD on March 1, 2001 4:20:32 PM    

Edited by - SD on March 1, 2001 4:25:31 PM    
S.D.
someone''s gotta have an idea for me ! anyone??

S.D.
S.D.
Advertisement
Face it. No one''s going to be willing to spend the time to debug your code, especially when you plop out the whole thing without making any effort at all to narrow down the problem. Also before you ask someone to debug a program it would help if you even took the time to explain what the program is supposed to do!!!
Also, make sure you escape your code before you put it online. Gamedev has a specific "tag" used to output source code. Read the FAQ. It supposedly colors your code as well. You can't output raw code in HTML because of the problem with the greater than and less than characters. Replace them with > and <, respectively. I tried to give it a chance, but the code was unreadable.

Edited by - jinushaun on March 5, 2001 8:02:30 PM

This topic is closed to new replies.

Advertisement