+ 16
Why output is "ouch" ?
I don't know why a==b is true. https://code.sololearn.com/cx5qt0lux4pF/?ref=app
8 Respuestas
+ 12
Let's elaborate it a bit :
When we decade a string on this manner :
char* word = "World without L";
// Now that string is an array of characters and every single element can be accessed in this way :
first : *word
second : *(word + 1)
third : *(word + 2)
And so on, every time we add a number it increments the address but when you simple use : word, it will display the entire word(unless you increment it permanently using pre and post increment)
In the above example we are checking the equality of just the first character, so the output is ouch.
+ 13
Both *a and *b are 'c' (first char of char array), so they're equal
+ 11
Use "if (a==b)" to get "awesome"
+ 9
Makes sense. Thank you so much.
+ 3
its simply because the adresses pointed have the same datatype char
+ 1
makes sense
+ 1
Because a and b are char so they consider only c as initial value so they are equal