C++ Question

Started by
1 comment, last by Legene 23 years, 2 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; }
Advertisement
You mean like:
class maze
{
public:
maze(char *name);
...

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

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

Legene

This topic is closed to new replies.

Advertisement