Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
2.67/5 (2 votes)
See more:
Hi
I want to know what is the mean of these declarations?

C++
Structure struct (); 
struct* s1 ;

OR

Class class1();
class1* c1;


Which thing will allocated in s1 or c1 ?
Generally when we declare a pointer from a class or structure what thing will happen , I want to know !


And finally , what is the iterator in c++ ?
I saw this code and I couldn't understand what is that mean?

C++
std::vector<cv::Vec3f>::iterator itrCircles;
QString::number((*itrCircles)[0]).rightJustified(4 , ' ')



Thanks a lot !
Posted

See here[^] for full details of the C++ language.
 
Share this answer
 
None of this is legal C or C++ syntax.

First of all, you're not even using the correct keywords. Keywords and symbols in C/C++ are case sensitive.

Second, your syntax is off: you didn't put the keywords and symbols in correct order for your statements to make sense.

Third, declarations of a struct or class use curly braces {} to enclose their contents, not rounded braces () .

Fourth, pointers do not allocate by themselves. They're like road signs pointing to some thing in the distance so you can find it. That doesn't mean the sign created that thing however,

Fifth, the code snippet that confused you so much is at an entirely different level of understanding than the previous things you didn't understand in the first place. There is no point in even trying to explain that.

Seriously: a good tutor teaching only you, personally, might be able to explain that snippet to you to the point that you really understand it in, say, a week. If you were an experienced programmer (experienced in other computer languages that is), maybe two days would be enough. Please understand we cannot provide that level of personal tutoring here.

I suggest you follow the link Richard provided in solution 1, or use any other C++ reference or book that you like, and first learn the basics.

Or, if there is a reason you need to understand that code snippet, maybe you should explain that reason to us, so we might help you solve the real issue behind your question.
 
Share this answer
 
Comments
nv3 22-Mar-13 5:40am    
My 5 for the effort, although I think it is lost in that case :-(
Stefan_Lang 22-Mar-13 5:55am    
Thank you :)

I've found that people asking apparently clueless questions like that often can be helped if told where to begin. The problem is often that they don't realize just how little they understand, so they need someone to point that out and explain what it takes.
Steve44 22-Mar-13 19:45pm    
Well said, my 5.
Unfortunately not everyone on this site thinks along these lines and berating those asking the questions and those answering them to get those guys that want to learn on the right track is sometimes seen.
Just sad.
Steve.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900