vendredi 10 novembre 2023

Cstring errors in C++ [closed]

I cant seem to figure this out, I'm supposed to take an argument as a cstring and keep getting the error:

string.h:18:18: error: expected ‘)’ before ‘input’
      String (cstring input) {
                       ^
     make: *** [string.o] Error 1

This is the rest of the segment of code:

 String (cstring input) {
   int i = 0;
   while (input[i] != "\0") size++;
   buffer = get_new_buffer(size+1);
  }

I tried to create it using a string, but was told im not allowed to, havent been able to figure out anything else.

Aucun commentaire:

Enregistrer un commentaire