You are here:

C++/okay....still a few problems

Advertisement


Question
Hi eddie....
how are you?? hope ur doin well...
my questions are-

1)
i tried the sleep() but the compiler points out an error that sleep() needs a prototype...however i have the windows.h file in the header file so i really dont know what the problem is....

However is there any alternate program i can use...i have dev-c++ but i dont usually compile on that program because at college we use turbo c++...

2)
regarding the menu...that would be a good idea but someone recently posted on a foroum that the function return would be a better idea...any particular way of using it and what header file does it belong to...

3)
Is the time() and sleep() similar in any manner..i soemhow got the time function to work but when running the program it makes the program a bit "yucky" as it looks like the pc got hung .....

Lol..anyways keep helping and thanks a lot for taking your time...

Varun Kumar
p.s. - is there any chance personal correspondence would do?? i really appreciate it that way..


Answer
Hello Varun, thank you for the question.

1)
I don't know if this was just an oversite, but the function is called Sleep() with an uppercase s. This might fix your error.

2)
I am unaware of a function called return. In fact, it couldn't be called that since that is a keyword.

3)
The time function actually gets the time of day from the hardware. Sleep forces a system pause.

No problem. Let me know if you have any more problems.

- Eddie

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Eddie

Expertise

I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by ExpertRating.com. I also know a good deal about graphics via OpenGL, and GUIs.

Experience

I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2016 About.com. All rights reserved.