I'm new to the C language, and I can't understand why my code gives an error, please help me
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
char* d(char*);
int main(){
char* str = "Google";
d(str);
return 0;
}
char* d(char* str){
int x = 0;
int len = strlen(str);
while (x != len){
if (str[x] == str[x+1]){
str[x] = 0;
str[x+1] = 0;
}
x++;
}
str = '\0';
return str;
}
I need to draw a field without repeating letters