Print on serial with mbed

Hello I am new to the mbed os
I have been trying to print on serial
I tried using this code which I found on one the forums here :

#include <mbed.h>
#include “SerialStream.h”

BufferedSerial serial(USBTX, USBRX, 115200);
FILE * pc;

int main() {
pc = fdopen(&serial, “r+”);

while(true)
{
    fprintf(pc, "Hello world!\n");
    ThisThread::sleep_for(1s);
}

}

but I get this error Identifier “nulptr” is undentified serial stream(serialclass_&_serialclass , const char*name =nullptr)"
is there something I can do here to fix this code or is there any other way to print on serial
?