#include <ctime>
#include <cstdlib>
bool winner = false; 
winner = true;
         
srand((unsigned)time(NULL)); 
comp_choice = rand() % 3; 

 
system ("PAUSE");
return 0;
 }

How to transform this idea or this codes to simple codes in IOSTREAM Library

I dont understand what your trying to do,

Into an iostream library? there is no input or output which is what iostream is for.


Can you explain a bit further what you are trying to achieve please?

aha bro this im using it in string and ctime library and i want to use it in iostream library how to write it ? in iostream library

You still are not being very clear in what you are trying to do, so let me put on my pointy, star-covered wizard hat and see if I can read your mind...

You have been able to output random times and/or values to a string, but you want to do the same to a stream?

Ok. I give myself about a 2% likelihood of being in the ballpark. :rolleyes:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.