Logging to Console on PROS

I was just wondering whether or not there was a way to print to a debugging console in PROS.

Both printf and cout work for printing to the console.

1 Like

for example:
operaotr.cpp

void opcontrol()
{ 
int i=0;
     while(1)
       {
           std::cout<<i<<std::endl;
        i++;
        }
}

u can open terminal with ctrl + `

then input:prosv5 terminal

Thx. I was confused whether or not you could use cout in PROS because whenever I did it, it gave me an error.

*.cpp
if use file.c
u can’t use cout

What code gave you an error? The following should work out of the box:

// in opcontrol.cpp
void opcontrol() {
    while (true) {
        std::cout << "hello world" << std::endl;
        pros::delay(20);
    }
}
1 Like

I think it may just have been a stupid mistake on my part. But I cleaned my project and it didn’t give me the error again

1 Like