Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compiler not detecting the error !!!

Status
Not open for further replies.

enigmatrix

Programmer
Aug 24, 2000
8
0
0
IN
CTime time;

time.CTime::GetCurrentTime();

//above statement is passed through the compiler
//but no errors or warnings have been issued
//I was compiling with Visucal C++ 6.0
 
What error do you expect the compiler to throw? Can you give more detail about what it is all about?
- Karthika
 
Your statement doesn't look right. GetCurrentTime is a static funciton of CTime. Try this instead

CTime time;
time = CTime::GetCurrentTime();

Matt
 
I just tried it... It works even though it looks wrong but this statement equivalent to
time.GetCurrentTime();

Since GetCurrentTime() is a static fucntion you don't have to create an instance of CTime to call it. You can call it directly just like c-library function. CTime:: part of the statement just specifies the scope where the function can be found.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top