Converting char to char*

Hey I am working on a small sms messaging project using arduino micro and fona 808 module.

I have a list of numbers stored as .csv and the goal is to send the message to everyone in the list. I am reading .csv via processing ide, no worries.

Phone numbers are 11,12 digit integers. I have managed to succeed in converting read from serial monitor integers into char. However, fona library function fona.sendSMS requires char* as an input for a phone number.

Hence, I struggle to convert integer (or char) into char* - char pointer.

I tried String, but it does not support 11-digit numbers and converts it to other base number.

This is what I have now - returns "invalid conversion from 'char' to 'char*' in sendSMS line.

byte index = 0;
char numin[32];
char numout;

void loop() {
      
      
      if (Serial.available ()) {
        numout = Serial.read(); 
        numin[index] = numout;
        index++;
        numin[index] = '\0';

        Serial.print (numout);


        fona.sendSMS(numout, "hello how are you?");
}

I tried itoa() too, but no luck either, yet output was different, but still wrong.

Is there any way I can input 12 digit number at all?

One does not convert a char into a char pointer. One creates a char pointer to a char.

But do you have a char or a char array? The answer is a bit different for the two. For a char array it's simple. The name of the array without any [] braces is a pointer to the first element.

char myString[] = "12345678912"
someFunctionThatTakesCharPointer(myString);

Or you can use the address of operator to get a char8 to a single char. But be careful, most functions that take a char* are looking for a string, and those need a terminating null, so they're never just one char.

char myChar = '5';
char* charPtr = &myChar;
someFunctionThatTakesPointerToChar(charPtr);

'numout' is a single character; fona (my interpretation of your description) wants (a pointer to) an array of characters (basically your 'numin').

So the first thing that is wrong is the use of 'numout' when you call sendSMS.

The second thing that is wrong is that you send an sms every time that you receive a character from the serial port. That does not make sense.

I suggest that you read Serial Input Basics - updated to get an idea how to process serial data and based on that modify the PC side to e.g. send something like '0123456789\n' (example 2).

Oh, and you don't need to convert stuff to integer; it's all text based.