Jump to content
MakeWebGames

C++ help needed


Renkia

Recommended Posts

Hey Makewebgames/MCC Forum:

I Was on the (C++) website, learning C++ of course. But, there a problem I can't get my head around. Allow me to put a lower, description:

The input!:

 

// i/o example 
#include <iostream> using namespace std;
int main(){      int i;      cout << "Please choose a random number!";       cin >> i;      cout << the nuber you have choosen is << i;      cout << "and its double is " << i*2 << ".\n";      return 0;}

 

 

The output!:

Please choose a random number! 702 the value you entered is 702 and its double is 1404.

 

Now, it doesn't explain how on http://www.cplusplus.com how ( i; ) is the number 702? Its really gotten on my mind, all day.

I Have set the syntax right, it doesn't appear right thou, sorry.

Thanks, for reading

Rasheed Saeed (Renkia)

Link to comment
Share on other sites

No, it takes your direct input and assigns it to the i variable.

For instance, if a process is waiting for input from the console, the OS can look at the processes information and see which io ports its waiting for. It can check those ports to see if they have any data for the process to work on. If they do, it can start the process up again, but if there is no data, then that process gets skipped over for the current timeslice.

To explain that in human terms:

The process actually waits, to get the user input. And then continues to follow the set of rules you defined(the program).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...