helllo guys ..as its my first topic here i have to say: wow thats alot of information in this forum... actually am beginner to c++ i know the basics(classes,vectors,containers,arrays,pointers,control statements)..so i just need to learn the rest and some practice so here come my LITTLE QUESTIONss:d
i know the library <ctime> and i have only used it with <cstdlib> srand ..but can i use it (or if there another way ofcourse)to make a program change value with time ? i mean lets say in second 0, x=1 ,in second 10 x=3.in secon 50 x=6 ..is it possible?
another question ..where i can find a place(website or ebook) which can provide me several exercices with its soloution so i can practice
i know the library <ctime> and i have only used it with <cstdlib> srand ..but can i use it (or if there another way ofcourse)to make a program change value with time ? i mean lets say in second 0, x=1 ,in second 10 x=3.in secon 50 x=6 ..is it possible?
Sure, just store the initial time value and use the difference later, possibly with a multiplier.
1 2 3
const time_t startTime=time(0);
[...]
int x=(time(0)-startTime)/3;
As for exercises, you should do some "real" small projects that interest you in order to get better.