How to print a string variable to the brain screen

Hello, I am working on a project currently and have hit a roadblock. I have a string variable called text that acts as a parameter to a function, and within that function I want to print text to the brain screen. But, when I try “Brain.Screen.print(text)”, it throws this error

“C:\Program Files (x86)\VEX Robotics\VEXcode Pro V5\sdk/vexv5/include/vex_brain.h:198:28: error: cannot convert ‘std::basic_string’ to ‘int’ without a conversion operator
print( “%d”, (int)value );
src/main.cpp:172:18: note: in instantiation of function template specialization ‘vex::brain::lcd::print<std::basic_string >’ requested here
1 error generated.
make: *** [vex/ build/src/main.o] Error 1
[error]: make process closed with exit code : 2”

Does anyone know how to fix this or get around this?

I just had this issue and here’s my search result:

You can fix it by converting it to a C-style string (const char*):


Most of the time we face problems that someone, somewhere in the world had it before we did, so searching could be the quickest way to solving problems.


Thank you so much, it worked! And I’ll keep that in mind

1 Like