Advertisement

C++ Question

Started by February 14, 2001 12:34 AM
1 comment, last by Legene 23 years, 11 months ago
I don''t understand how to pass a file from the main function into a constructor that is part of a class. Any info would be greatly appreciated. My code is below. Legene maze.h class maze{ public: maze(); void transverse(); void get_data(); void print_data(); private: int intersections[200]; int transversal[200]; }; maze.cpp #include #include "maze.h" maze::maze(char name[]) { } main.cpp #include #include "maze.h" main() { maze m; return 0; }
You mean like:
class maze
{
public:
maze(char *name);
...

maze::maze(char *name)
{
...
}

void main()
{
maze m("something");
}
Advertisement
That''s it, thanks alot.

Legene

This topic is closed to new replies.

Advertisement