Question:

Visual C++ Express Edition Help?

by  |  earlier

0 LIKES UnLike

i am writing a program and i keep getting an error that says

left of '.visited' must have class/struct/union

what is a class/struct/union error?

this is my first time programing so i have no idea what to do. any websites would be helpful as well.

 Tags:

   Report

2 ANSWERS


  1. Next time post your code.

    You have written something like x*x.visited = blah;

    That makes visited part of the clas or struct or union named x*x.  Either you have nothing in front of the period, or you have something not defined in front.

    If you had a class named MyClass that had a public data member called visited, you could access it by typing MyClass.visited

    Same if you had a struct or union defined that had a member called visited.

    Without seeing your code, can't be more specific for you.

    Google    c++ "must have class/struct/union"

    This will give you answers and is a way to find out what's going wrong.


  2. You probably have some identifier in front of ".visited", for example "my_variable.visited". The dot operator tries to access a member of "my_variable" called "visited". This will give an error if the type of my_variable is not a class, struct, or union - that is, if my_variable does not _have_ members.

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.