What will happen if i declare variable like this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
30th Mar 2019, 2:29 AM
Yashwant Kaki
Yashwant Kaki - avatar
1 Answer
+ 5
You can use a char to initialize a float with its ASCII value: float f = 'A' => f will be 65.0. It's just that 'aa' is not a valid char literal. A char can only be one character. Also, "String" in line 3
30th Mar 2019, 6:35 AM
Anna
Anna - avatar