#why we use %s not % some other letters
1 messages · Page 1 of 1 (latest)
Ok so
a string, is an array of characters. Think of a string like so
'H', 'e', 'l', 'l', 'o'
alright
now
%s
intuitively could mean string no?
so if you want to input a variable into a predefined string
your gonna wanna tell the compiler what type of "thing" your inputing, so it can do the conversion
s = string, d = digit, c = character, f = floating point
oh I see
There is more variable tho right?
I changed floating point to C
I can't use the variable twice?
becs gpa didn't give the result
gpa is a type float and you're using %c. c is for character (char)
If you look at what King Polar Bear sent you, you can see which letter you need to replace %c in your printf to properly do that.
King Polar Bear explained it here ^
thanks boys