C++ loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 13

C++ loop

How can I make a function that is repeated each fram of the program in c++? In javascript the equivalent would be "setInterval(my_loop_function,1000/my_FPS_variable);"

10th Dec 2016, 3:19 PM
Dapper Mink
Dapper Mink - avatar
2 Answers
+ 9
That's not what I want, I want a loop that repeats all the time like a while(true){/*game code here*/} but a while(true) may cause errors right? and I can't know how fast the while is repeating
10th Dec 2016, 3:31 PM
Dapper Mink
Dapper Mink - avatar
+ 1
you can write for( int I=0;I<n;I++) { //call your function here ;} this statement will call your function n times
10th Dec 2016, 3:29 PM
Abdil Fattah Boshi
Abdil Fattah Boshi - avatar