Sign in to follow this  

COORD in a class

This topic is 4824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok... im writing a small program IN C++ USING msc++ to get classes down better. The program will be in a dos window (eg. console app.), and am using the "SetConsoleCursorPosition()" FUNCTION, WHICH REQURES A coord. I am wondering if it is possible to create a COORD as a class member variable? So far all of my attaemps have failed.

Share this post


Link to post
Share on other sites
I took out everyhting but the coord for this:

#include <iostream.h>
#include <stdlib.h>

class mammal
{
public:
mammal(){}
virtual ~mammal(){}

virtual void setX(int x) {c.X = x;}
virtual void setY(int y) {c.Y = y;}

private:
COORD c;
};


errors:

error C2146: syntax error : missing ';' before identifier 'c'
error C2501: 'COORD' : missing storage-class or type specifiers
error C2501: 'c' : missing storage-class or type specifiers

Share this post


Link to post
Share on other sites

This topic is 4824 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this