I actually posted my code then deleted it for idk what reason, apologies for making you go through that horrendous mess.
I want to off myself.
Does compare() not take spaces into account?
Use this: cout << "*" + result + "*"; your string has indeed a trailing space. And next time post your code, not an image (I had to rewrite all your code to test it). Use markdown formatting and mark your post as having spoiler content.
I used malloc. it didnt matter, I couldnt return the string, on the char array. I need to learn more about character arrays clearly as I have no idea how to return a whole string.
Why dont just use '+', '-', ...
They are the same as the numerical values, the other is more confusing and is only for ASCII
There is no ISO C 2020 standard. There is no reason to assume this valid syntax will be invalidated in the future.
No
check your output in tests
printf("%s\n", buffer);
most likely a problem at the end of the line
'\0'
I actually posted my code then deleted it for idk what reason, apologies for making you go through that horrendous mess.
I want to off myself.
Does compare() not take spaces into account?
Use this:
cout << "*" + result + "*";
your string has indeed a trailing space. And next time post your code, not an image (I had to rewrite all your code to test it). Use markdown formatting and mark your post as having spoiler content.This comment is hidden because it contains spoiler information about the solution
Check for trailing spaces in your returned strings.
https://i.imgur.com/mXSq9Ad.png ?
Is this kata working because my compiler says it's a match but on kata it isn't... ?
Passes all random tests, works as it should. Yet I get this error:
The expression strcmp(buffer, "01011110001100111") == 0 is false.
I like this one. Good use of the ascii values.
check this out, it helped me: C online tutorial
I used malloc. it didnt matter, I couldnt return the string, on the char array. I need to learn more about character arrays clearly as I have no idea how to return a whole string.
You need to return a dynamically allocated string.
Loading more items...