Printing to Brain Screen Through a Class

Alright so during this extremely early off-season, I’m creating an experimental class for this coming season #watergame. Jokes aside, I’ve been trying to just simply print a string variable to the brain screen and can only do so if it is printed by itself, as in it is the only parameter to the print function. Due to this just taking up space, I would like to condense my printing code to one line but can’t as I keep getting the same error as shown in the pic even when it is placed into its own function. Any help would be much appreciated.

Edit: Added following pic so you can see the entire function.

The print function cannot take strings. Instead, it takes char arrays (probably because the function acts just like printf, a C function [C does not have strings]). I’m not sure what the function is to convert strings to char arrays, but it should be c_str();
In your case, you would just replace name with name.c_str(). Hope this helps.

1 Like