char *result memory allocation

Hi All,

Thank you for taking time to read my post.

I create a variable
const char* result;

and I get data from serial port as a String^ and convert it to my result this works fine.

I receive a string and when I debug this the variable result gives me the string just as it should be.

this gives me two questions

Can I put a whole string in a const char* result is this overwriting other data / can my string be overwritten by other data?

how does the compiler knows how much data to reserve?

Can I detect how long my string is?

Many Thanks,

Jorz
Last edited on
Topic archived. No new replies allowed.