sfuo 111 Practically a Master Poster

The problem is because you are setting your "destination point" on line 26 to invokeX/Y (0,0) and getting the distance from the invoke point (0,0). So either I would delete line 26 and replace destinationPoint on line 35 with pt1.

sfuo 111 Practically a Master Poster

Here is the timer class.

It is pretty easy to use. You just have to initialize a timer then set the delay using setDelay(x) (where is is in milliseconds) and then use start() to start it up. Then use checkDelay() to check to see if the timer is up or not and if it is then use restart() to reset the timer so you can delay your next motion.

There are a few things in here that you might not need to use such as the setCD() function because it was made for some game using ability cooldowns.


timer.h

#ifndef TIMER_H
#define TIMER_H

class TIMER
{
    int startTicks;
    int pausedTicks;

    bool paused;
    bool started;

    int delay;
    int timeBuffer;

    public:

    TIMER();

    void start();
    void stop();
    void pause();
    void unpause();
    void restart();

    int getTicks();

    bool isStarted();
    bool isPaused();

    int  getDelay();
    void setDelay(int delay = 1000);
    void setCD(int delay = 1000);
    int getSecondsLeft();
    bool checkDelay();
};

#endif

timer.cpp

TIMER::TIMER()
{
    startTicks = 0;
    pausedTicks = 0;
    paused = false;
    started = false;
    timeBuffer = 100;
}

void TIMER::start()
{
	if(started == false){
    	started = true;
	    paused = false;
    	startTicks = clock();
	}
}

void TIMER::stop()
{
    started = false;
    paused = false;
}

void TIMER::pause()
{
    if( ( started == true ) && ( paused == false ) )
    {
        paused = true;

        pausedTicks = clock() - startTicks;
    }
}

void TIMER::unpause()
{
    if( paused == true )
    {
        paused = false;
        startTicks = clock() - …
pcgamer2008 commented: Yeah ! nice ..good idea for time based game projects +0
sfuo 111 Practically a Master Poster

I see the problem at line 33 of your first post.
Replace that line with

vector<User> &getUsers() {return users;}

The problem is that you are getting a copy of the user then you are modifying that but not the original copy of it.

Vanquish39 commented: Good catch +1
sfuo 111 Practically a Master Poster

It will only output the last letter because a char type is only one character. You can use a string and add the letters onto that then output the word with outFile.

sfuo 111 Practically a Master Poster

#1 if you look at the code I posted I spent a bit of time formatting it so that it is pretty easy to read. You need to learn how to use tab/indents otherwise when someone reads your code it will be very difficult for them to figure out what is going on.

The way you have validGrade() right now it will always return true because the way I had it set up for you was like this.

bool validGrade( int in )
{
	if( in >= 0 && in <= 100 )
		return true;
	return false;
}

Notice that in is the variable used to store the variable that was passed into the function. You are using the name of the function for some reason and that is wrong. You check to see if the grade is 100 output some stuff and then right when the if ends it returns true without ever having a condition where it could return false. The code I posted above shows that it checks to see if the grade is between 0 and 100 -- if this is true then return true otherwise it wont run what is inside the if statement and it will just return false.

In your convertGrade() function you have kinda the right idea other than the fact that you are not testing against a variable so you would have to put if( in >=90 && in <= 100 ) to get the desired result. Anything …

sfuo 111 Practically a Master Poster

That looks like you copy pasted it off someone elses post because of all the # sitting between the lines.

sfuo 111 Practically a Master Poster

First of all you havent declared nSel any where but you are using it, so put int nSel = 0; before the cout lines or something (just before usage).

Then for your while loop you should make it so it loops while nSel is not 1 AND 2 not or. while((nSel != 1) && (nSel != 2))

ndowens commented: Helped me with my code issue +1
sfuo 111 Practically a Master Poster

Use a do{}while() to loop in main() I would not recommend calling main().

int main()
{
	char askLoop;
	do //do enters the loop weather or not the condition at the bottom is met on the first run
	{
		double tax, pay;
		termlength_determine();
		cout << "how much do you get paid per hour?: " << endl;
		cin >> pay;
		system("cls");
		cout << "How much tax do you get taken out of your check \n in percent form?:";
		cin >> tax;
		system("cls");
		gross_pay = hours_total * pay - (pay * (.01 * tax));
		cout << "your pay after taxes is: $" << gross_pay << endl;
		system("pause");
		askLoop_function();
	}while( askLoop == 1); //sets the condition for looping
	
	return 0;
}
sfuo 111 Practically a Master Poster

An easy way to think of a string is that its an array of characters in C and a vector of characters in C++.

Meaning it can hold any character. If you want something like " ' or \ in it you need to put an escape character before it like
mystring = "\\"
mystring = "\""

sfuo 111 Practically a Master Poster

I fixed it up so it actually runs but I removed the whole height_in_feet variable because it was not being used.

Since there are so many errors I would suggest you relearn the basics of functions.

Check this against yours and see where you went wrong.

#include <iostream>
using namespace std;

//prototypes
void Get_Data( int&, int& ); // reads the weight, height in feet, and height in inches
float Hat_Size( int ); // returns the hat size to the main
int Jacket_Size( int, int ); // returns the jacket size to the main
int Waist_Size( int ); // returns the waist size to the main
void Put_Data( float, int, int ); // writes the sizes

int main()
{
	int weight, height_in_inches;
	float Hat;
	int Jacket, Waist;

	//Read the Count for the Loop of
	int loop_target;

	cout << "Enter the Amount of Times You Would Like to Loop this Program : ";
	cin >> loop_target;

	for( int count = 0; count < loop_target; count++ )
	{
		Get_Data( weight, height_in_inches );
		Hat = Hat_Size( weight );
		Jacket = Jacket_Size( height_in_inches, weight );
		Waist = Waist_Size( weight );
		Put_Data( Hat, Jacket, Waist );
	}
	//system("PAUSE");

	return 0;
}


void Get_Data( int &weight, int &height_in_inches )
{
	cout << "Please Enter the Weight in Pounds:\n";
	cin >> weight;

	cout << "Please Enter the Height in Inches:\n";
	cin >> height_in_inches;
}

float Hat_Size( int weight )
{
	return (2.9)*(weight)/(4.9);
}

int Jacket_Size( int height_in_inches, int weight )
{
	return (height_in_inches)*(weight)/(288);
}

int …
sfuo 111 Practically a Master Poster

Yeah any translations/rotations done in projection modifies the camera and in modelview you are moving the objects.

sfuo 111 Practically a Master Poster

Move the camera back by translating (0,0,-10) units in matrix mode projection.

I know the basics of setting up OpenGL stuff but it looks like you are using java where I know it in C++.

sfuo 111 Practically a Master Poster

I'm not 100% sure why its not working for you and I can't figure out how to fix any of the errors in Example::render onResize WndProc and all that if I don't actually know the error message, unless you are saying that they are all getting linker errors.

I was getting warning when compiling so I changed your GLWindow() function so it sets the variables within the brackets rather than in the unique way you had before.

Also you were using CreateWindowEx() and passing NULL for the extended styles when you can just use CreateWindow() because that parameter just doesn't exist in the function.

I've attached the source code from what you posted with the changes I made. I also included the project file (code blocks) that if you do use the same compiler then you can take a look at that and compare to see if you have something different.

sfuo 111 Practically a Master Poster

If you aren't using the animate function right now comment it out or make the function and just don't have anything in it (currently you have the prototype but no real definition and that is what is giving the error). Also when I read through your code your stick man is being drawn behind the camera so change stickFig1.render(1.0f, 1.0f, 1.0f); into stickFig1.render(0.0f, 0.0f, -30.0f); Also I was getting a whole bunch of warning but I'm not gonna go about messing with it since it works right now.

Edit: Both of the functions are in the example.cpp file and the line stickFig1.animate(dt); in the function prepare(float) should be commented out. In the function render() stickFig1.render(float, float, float) should be changed as stated above.

sfuo 111 Practically a Master Poster

Missed the end quote so that would return an error.

NicAx64 commented: ops +2
sfuo 111 Practically a Master Poster

ppoly1 is a pointer to a CPolygon.
The class CPolygon does not have an area() function so if you try to call that directly it will error.
You can call the function set_values(int, int) because in the CPolygon class that function exists.
You can point to rect or trgl because they are built off of the CPolygon class (they are CPolygon plus whatever you add to it in the new class).
This means that you can call functions with a higher class (CRectangle) from a lower class (CPolygon) but not the other way around unless they are defined virtually.

sfuo 111 Practically a Master Poster

Not sure if you want to add the extra number in so you know how long the vector is. Otherwise you would have to read it in and check for the commas.

#include <iostream>
#include <vector>
#include <deque>
#include <fstream>

using namespace std;

struct Entry
{
	int addr;
	int dst;
	int size;
	vector<int> path;
};

/* "test.txt"

1 A0003 128 3 4 4 4
2 A0005 128 4 1 8 3 2
3 A0002 128 2 2 2

*/

int main()
{
	deque<Entry> myFile;
	ifstream in("test.txt");
	Entry temp;
	while( in >> temp.addr )
	{
		int counter;
		in >> hex >> temp.dst >> dec >> temp.size >> counter;
		temp.path = vector<int>(counter);

		for( int i = 0; i < counter; i++ )
			in >> temp.path[i];

		myFile.push_back(temp);
	}

	in.close();

	//not sure if you wanted this to print to a file or something but its exactly the same just make an ofstream and replace cout
	for( unsigned int i = 0; i < myFile.size(); i++ )
	{
		cout << "Show the parameters " << myFile[i].addr << endl;
		cout << hex << myFile[i].dst << dec << endl;
		cout << myFile[i].size << endl;
		for( unsigned int c = 0; c < myFile[i].path.size(); c++ )
			cout << myFile[i].path[c] << " ";
		cout << endl;
	}

	return 0;
}
sfuo 111 Practically a Master Poster

In gluPerspective() the 60 is the angle of viewing if you think about your eyes you have a limited field of vision I'm not 100% sure what angle we can see at but most examples that use perspective use 60 (from what I've seen at least). For the type casting I'm pretty sure I tried it without casting it as a GLsizei and I got a warning so I just cast it to the right type.

I'm not too sure what glutInit() does but if there is an open source version of glut (freeglut) that you can check to see what goes on in that function but it will just be a general initialization that acts based on your OS (GLUT is multi-platform). As for my Init() function I use this to set up all the OpenGL state variables (ie depth alpha lighting materials) and maybe assign some objects values when I'm testing since it gets called right at the start.

sfuo 111 Practically a Master Poster

This sets up the viewport (part of the window that will get rendered onto)
You can have more than one viewport but for this we are using one.

glViewport(0, 0, (GLsizei) WINDOW_WIDTH, (GLsizei) WINDOW_HEIGHT);

This sets up the perspective and near far distances (anything drawn 1 to 20 units from the camera will be seen, anything else is not drawn. The camera is also positioned.

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

gluPerspective(60, (GLfloat) WINDOW_WIDTH/ (GLfloat) WINDOW_HEIGHT, 1, 20);

glTranslatef(0, 0, -10); //move camera back 10 units from the origin (0, 0, 0)

This part now effects the world that you draw.

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0, 0, 0); //moves the objects by what you set it to
sfuo 111 Practically a Master Poster

I would test this code out but I do not have glut on this computer.

The main issue that you have is that you are not setting up your view port projection matrix and model matrix.

#include <windows.h>

#include <gl/gl.h>
#include <gl/glut.h>
#include <math.h>

typedef struct
{
	float x;
	float y;
} CIRCLE;

CIRCLE circle;

int WINDOW_HEIGHT = 800, WINDOW_WIDTH = 600;

void init()
{
	glClearColor(0.0, 0.0, 0.0, 1.0);
	glShadeModel(GL_SMOOTH);

	glEnable(GL_DEPTH_TEST);
}

void DrawCircle()
{
	glViewport(0, 0, (GLsizei) WINDOW_WIDTH, (GLsizei) WINDOW_HEIGHT);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	
	gluPerspective(60, (GLfloat) WINDOW_WIDTH/ (GLfloat) WINDOW_HEIGHT, 1, 20);
	
	glTranslatef(0, 0, -10);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	//objects
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glPushMatrix();
		glTranslatef( 0.0, 0.0, 0.0 );
		int k = 5, r = 5, h = 5;
		glBegin(GL_LINES);
			for (int i = 0; i < 180; i++)
			{
				circle.x = r*cos(i) - h;
				circle.y = r*sin(i) + k;

				glVertex3f((circle.x +k), (circle.y - h), 0);

				circle.x = r*cos(i + 0.1) - h;
				circle.y = r*sin(i + 0.1) + k;

				glVertex3f((circle.x +k), (circle.y - h), 0);
			}
		glEnd();
	glPopMatrix();
	glutSwapBuffers();
}

void Reshape(int w, int h)
{
	WINDOW_WIDTH = w;
	WINDOW_HEIGHT = h;
}

int main(int argc, char *argv[])
{
	alutInit(NULL, 0);
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
	glutInitWindowSize(800, 600);
	glutCreateWindow("Simple Circle");
	
	init();
	
	glutDisplayFunc(DrawCircle);
	glutReshapeFunc(Reshape);
	glutMainLoop();
	
    return 0;
}
ticktock commented: Very very helpful :D +1
sfuo 111 Practically a Master Poster

Not 100% sure why you are using an array to store your character since you are only using 1. Also when you make an array char answer[1]; that means that it has a size of 1 and it starts at 0 so you would use it like if( answer[0] == 'y' ) .

Also you have answer being declared multiple times through your code when you only have to do it once as long as it is being used in a scope (not sure if this is the right word) lower than the one it was declared in.

For example

int main()
{
	char a = 'a'; //a is defined in all of the main() function but no where outside of it

	if( a == 'a' )
	{
		char b = 'b'; //b is only defined within this scope
	}

	if( a != b ) //b is not defined in this scope
	{
		char a; //a is already defined so this should give an error
		a = 'b';
	}

	return 0;
}
Clinton Portis commented: good clarification +6
sfuo 111 Practically a Master Poster

First question is have you even made a 2D game before?

SDL is "good" because it makes the window, sets pfd, handles keyboard/mouse input and a few other things but I really disliked how you had to carry 50 dll files around with it just so you could have sound and textures. I found it really useful to start out with because instead of spending time learning how to make a window and do handling you are able to focus on figuring out how to make a game.

The next step I took was going to GLUT. It has many similarities to SDL with the window making and handling but with GLUT you learn how to draw with OpenGL functions and you actually learn lots more because when you break off GLUT and go WINAPI and OpenGL (if you use windows) then all you need to know is how to set up the window and manage the message loop.

I would start with a 2D game with GLUT just because SDL was good starter but the stuff I was able to transfer over to OpenGL was just the logic programming since they are too different to copy over handling methods.

Ancient Dragon commented: nice help and explanation +31
sfuo 111 Practically a Master Poster

I have never done this math before so I would double check with a few test examples to see if this works and if my math is right.

All I did was went onto wiki and pretty much plugged the equations they give into functions.

Anyways here is what I came up with you get an idea of what is going on and finish off what you need to if you haven't already.

sfuo 111 Practically a Master Poster

Add this line of code into your "counter.pp" file

int Counter::nCounters = 0;
sfuo 111 Practically a Master Poster

I totally didn't think of it like that. Use his code its way better =(

kvprajapati commented: Your post are very helpful. +6
sfuo 111 Practically a Master Poster

6 hours later I'm back!
Sorry, I got side tracked but anyways I managed to finished a version using functions (I could have made it using a class but I decided not to).
This is half as many lines as the other version you have.

#include <iostream>

using namespace std;

struct CARD
{
	bool isFlipped;
	int value;
};

void makeCardSet(CARD cards[4][4])
{
	bool makeNext = false;
    srand(time(NULL));
    
    for( int i = 0; i < 4; i++ )
		for( int c = 0; c < 4; c++ )
			cards[i][c].value = 0;
			
    for( int i = 1; i < 9; i++ )
    {
        makeNext = false;
        while(!makeNext)
        {
            int x1, y1, x2, y2;
            x1 = rand()%4;
            y1 = rand()%4;
            x2 = rand()%4;
            y2 = rand()%4;
            if( (x1 != x2 || y1 != y2) && (cards[x1][y1].value == 0 && cards[x2][y2].value == 0) )
            {
                cards[x1][y1].value = i;
                cards[x1][y1].isFlipped = false;
                cards[x2][y2].value = i;
                cards[x2][y2].isFlipped = false;
                makeNext = true;
            }
        }
    }	
}

void display(CARD cards[4][4])
{
	cout << endl << "  1 2 3 4" << endl;
	for( int i = 0; i < 4; i++ )
	{
		cout << i+1 << " ";
		for( int c = 0; c < 4; c++ )
			if( cards[i][c].isFlipped == true )
				cout << cards[i][c].value << " ";
			else
				cout << "0 ";
		cout << endl;
	}
	cout << endl;
}

int main()
{
	bool done = false, valid;
	int row[2], col[2], pairs = 0;
	char divider;
	CARD cards[4][4];
	
	makeCardSet(cards);
	
	while(!done)
	{ …
sfuo 111 Practically a Master Poster

Well I'll look into them a bit more and learn more about them thanks for showing me that they aren't out of date.

sfuo 111 Practically a Master Poster

I put together this to show you the void function part and I included how to make the 5 random numbers.

Things you need to do:
-User input for 5 numbers (check each to see if they are within 1-55)
-Make a checker for what numbers the user got right (in the void function)
-Output the numbers that the user got correct (in the void function)

#include <iostream>
#include <time.h>

using namespace std;

void check(int input[5])
{
	bool used;
	int randNum[5];
	memset(randNum, 0, sizeof(randNum));
	srand(time(NULL));
	
	//creates the 5 unique random numbers
	for( int i = 0; i < 5; i++ )
	{
		int number = rand()%54+1;
		do
		{
			used = false;
			for( int c = 0; c < 5; c++ )
			{
				
				if( number == randNum[c] )
					used = true;
				
			}
		}while(used);
		randNum[i] = number;
	}
	
	//checks to see what numbers the user got right
	
	
	
	//outputs numbers the user got right
	
	

}

int main()
{
	int numbers[] = {1, 2, 3, 4, 5};
	check(numbers);
	system("PAUSE");
	return 0;
}
sfuo 111 Practically a Master Poster

I have helped you out by writing what I think you want and put it into a "cleaner" format (could be more clean) and divided it into seperate files for structure. (file allinone.cpp is the whole thing in one file if this is for school and they want it in one)

I did my best to comment lines to show you what is going on.

I attached all the files.

sfuo 111 Practically a Master Poster

I wrote something for this and if you want to put in more numbers its really easy (not as easy if you would just use arrays) if you read the code and see what I'm doing.

#include <iostream>

using namespace std;

int main()
{
	int n1, n2, n3, n4, n5, a, b;
	
	cout << "input n1: ";
	cin >> n1;
	cout << "input n2: ";
	cin >> n2;
	cout << "input n3: ";
	cin >> n3;
	cout << "input n4: ";
	cin >> n4;
	cout << "input n5: ";
	cin >> n5;
	
	for( int i = 1; i <= 5; i++ )
	{
		switch(i)
		{
			case 1:
				a = n1;
				break;
			case 2:
				a = n2;
				break;
			case 3:
				a = n3;
				break;
			case 4:
				a = n4;
				break;
			case 5:
				a = n5;
				break;
		}
		for( int c = 1; c <= 5; c++ )
		{
			switch(c)
			{
				case 1:
					b = n1;
					break;
				case 2:
					b = n2;
					break;
				case 3:
					b = n3;
					break;
				case 4:
					b = n4;
					break;
				case 5:
					b = n5;
					break;
			}
			if( b > a )
			{
				int temp = a;
				a = b;
				b = temp;
			}
			
			switch(i)
			{
				case 1:
					n1 = a;
					break;
				case 2:
					n2 = a;
					break;
				case 3:
					n3 = a;
					break;
				case 4:
					n4 = a;
					break;
				case 5:
					n5 = a;
					break;
			}
			
			switch(c)
			{
				case 1:
					n1 = b;
					break;
				case 2:
					n2 = b;
					break;
				case 3:
					n3 = b;
					break;
				case 4:
					n4 = b;
					break;
				case 5:
					n5 = b;
					break;
			}

		}
		
	}
	
	cout << n1 << " " << n2 << " " << n3 << " " << n4 << " " << n5 << endl;
	
	system("PAUSE");
	return 0;
}
sfuo 111 Practically a Master Poster

In the future use the code tags to make it easier for us to read.

I compiled this and it ran fine. What did you need help with?

Ace1.0.1. commented: Helpful +0
sfuo 111 Practically a Master Poster

This is the C++ forum and you don't as people to do your assignments or whatever that is without showing some input other than what you want your output to be.

sfuo 111 Practically a Master Poster

Your prototype functions need to match your full functions below main() unless you are trying to overload the functions (I don't think you are).
Also the timeoffall value that you get out of the function stays in the function because you aren't passing a variable by reference or making it so your function has a return value.

I would change your prototypes to:

double timeoffall(double);
void velatimpact(double);

And then in your main() you can go:

velatimpact(timeoffall(h));

or split it up by making a variable store the value of timeoffall() and passing that into velatimpact().

And your timeoffall() function should be changed to something like this:

double timeoffall(double h)
{	
	double timeoffall;
	timeoffall = sqrt (h/4.9);
	cout << "the ball was in the air for " << timeoffall << "seconds" <<endl;
	return timeoffall;
}
Trini89 commented: Very Helpful, advice worked wonderfully +2
sfuo 111 Practically a Master Poster

Yeah I changed something in my post before testing it and it actually doesn't work the way it should. Good job getting it done.

sfuo 111 Practically a Master Poster

Another way to write this would be:

class Fraction
{
	int numerator;
	int denominator;
	char sign;
	public:
	Fraction(int _num = 0, int _den = 1, char _sign = 'p');
};

Fraction::Fraction(int _num, int _den, char _sign)
{
	numerator = _num;
	denominator = _den;
	sign = _sign;
}
Fraction(int _num = 0, int _den = 1, char _sign = 'p');

Having the '=' operator in the first declaration of the function makes it so if you do not give that parameter a value it will use the value stated as the default.

sfuo 111 Practically a Master Poster

Took me a while but I got it.
This uses only one cout << '*'; and according to the first post and my last post the outputs are not side by side but one below another.

I know there are no comments but the whole thing was confusing enough for myself.

#include <iostream>
using namespace std;

int main()
{
	for( int i = 0; i < 4; i++ )
	{
		for( int c = 0; c < 10; c++ )
		{
			int sadd = 0, fadd = 0;
			int xstart, xfinish;
			switch(i)
			{
				case 0:
					xstart = 1;
					xfinish = 10;
					
					fadd = -(9-c);
					break;
				case 1:
					xstart = 10;
					xfinish = 1;
					
					sadd = c;
					break;
				case 2:
					xstart = 1;
					xfinish = 10;
					
					sadd = c;
					
					for( int x = 10; x > 10-c; x-- )
						cout << ' ';
					break;
				case 3:
					xstart = 10;
					xfinish = 1;
					
					fadd = -(9-c);
					for( int x = 1+c; x < 10; x++ )
						cout << ' ';
					break;
			}
			
			if( xstart > xfinish )
			{
				xstart *= -1;
				xfinish *= -1;
			}
			
			for( int x = xstart+sadd; x <= xfinish+fadd; x++ )
				cout << '*';
			cout << endl;
		}
		cout << endl;
	}
	
	system("PAUSE");
	return 0;
}
restrictment commented: Great programmer! +1
sfuo 111 Practically a Master Poster

I knew you would say that because that is number 2 in your list of important things. lol

sfuo 111 Practically a Master Poster

As a general note if you want people to read your code learn to format it in a clean way. Having bad indents and no white space and cramming everything onto one line by throwing in semi-colons makes it just as hard to read if you don't use code tags and in the end when you compile this cutting out lines just makes it harder for you to go back to and fix up and will not make your file size any smaller.

I commented a few lines telling you what I did.

#include "stdafx.h"
#include <string>
#include <iostream>

using namespace std;

class vowels
{
	string input;
	int a, e, i, o, u, y;
	public:
	vowels();
	void getdata();
	void processdata();
	void display();
};
vowels::vowels()
{
	a = 0, e = 0, i = 0, o = 0, u = 0, y = 0; //made is so you dont redeclare the variables
	input = " ";
	getdata(); //when you make the variable class it auto starts the input instead of calling this function in main
}

void vowels::getdata()
{
	cout << "Enter String of Characters->> ";
	getline(cin,input);
	processdata(); //after input the vowel checker starts
	display(); //after vowel checker displays the data
}

void vowels::processdata()
{
	for( int x = 0; x < input.length()-1; x++ ) //added a for() loop for checking the string char by char not comparing the whole string
	{
		if( input[x] == 'A' || input[x] == 'a' ) //checks index 'x' and compares to a char …
jamdownian commented: Pure genius... +1
sfuo 111 Practically a Master Poster

I was able to get the same error as you by deleting the "player.cpp" file making it so only the prototype exists.

The only thing I can think of is is the "player.cpp" file part of the project? Sounds stupid but that would give you the error.

sfuo 111 Practically a Master Poster

Way to make 3 threads about one thing at the same time.

sfuo 111 Practically a Master Poster

I use devC++ and if I want to use the <cstring> library I do not need to use <iostream> or <iostream.h>. And I have never used MFC so I wouldn't know but since I don't use it you do not need to include it.

Frederick2 commented: thanks, you're right! +2
sfuo 111 Practically a Master Poster

The function mazeTraverse() is pretty much this whole program. It checks to see if the position in the maze that is it at is a space and then if it is it runs its self 4 items (up one spot, down one, left one, right one) and doing the same checks as before and if those spots are spaces then it runs its self another 4 times. This happens until it comes to a dead end.

Not sure if that helps it took me a few secs to look at the function to figure out what it was doing.

xxunknown321 commented: thank you +0
sfuo 111 Practically a Master Poster

I'm going to assume scanf() is like cin in the way that it cannot take in spaces.
One way to use cin to take in spaces is to use getline(cin, variable).
Then use cin.ignore() if you run into a problem with the '\n' character skipping inputs afterward.

sfuo 111 Practically a Master Poster

Look at where you are calculating their grades.

You have a for() loop that checks through the students to see if they have 10 absences or not then after that loop it goes to another loop that calculates their grade.

You want to take out the 2nd loop because it overwrites the final grade = 0 done by the 10 absences.

I see no problem with your modif() function unless you changed it in any way other than setting the indexes from your first post.

sfuo 111 Practically a Master Poster

First of all, you should learn how to click the code button to put code tags around your code.

Second two of us posted fixes for this already but if you really want to use this very first post then read the comments below for the change in code.

#include <iostream>
using namespace std;

void drawShape(int nrP)
{
int s1 = 0,s2 = 0;  //(NEW)

for (int i = 1; i <= nrP; i++)
{
    s1 = i - 1;
    s2 = (2 * nrP - 2 * i - 1); 

    for (int j = 1; j <= s1; j++)
        cout << '^';

    cout << '#';

    for (int j = 1; j <= s2; j++)
        cout << '^';
    if( i != nrP ) //this says if it is on the last line then do not output
        cout << '#';

    for (int j = 1; j <= s1; j++)
        cout << '^';

    cout << endl;
} 
}

int main()
{
   int nr = 0;

    cout << "Number of rows: ";
    cin >> nr;
    drawShape(nr);

    return 0;
}
mrnutty commented: Starting to help out, eh? +5
sfuo 111 Practically a Master Poster

1. When I insert elements into the vector, I cannot insert an element higher than 1.. only 0's and 1's.

What is DEFAULTSIZE set to because if it is 1 then yeah 0s and 1s are within the range you set in your if() statement.

2. When I dump the elements all I see are 0's and 1's

Your dump is showing you what you have inside of the vector so if you put 1s and 0s in you are going to get 1s and 0s out.

3. I don't understand if set(int n) is correct or not? Can anyone clarify?

You are not setting it to n you have the number 50000 in the resize parameter which would make the vector have 50000 elements and fill them with 0s. I think you want it to be resize(n); putting false in there is just redundant.

4. Do all the other functions look right?

As for the rest it looks fine aside from the fact that your getLargest(), getSmallest() and isIn() functions have no return value. Just put

return *( min_element( setlist.begin(), setlist.end() ) );

and it will return the smallest value and do the same for the others.

Also, you have this cardinality variable. Is this supposed to track how big the vector is? If so you want your set(int n) function to be

set::set(int n)
{
     if( n >= 0 )
     {
          cardinality = n;
          setlist.resize(n, false);
     }
}

Again I have no idea what DEFAULTSIZE …

kvprajapati commented: I like your way. +17