0

Compare between pointer and integer

Sometimes when I created a character variable in C programming and check the value in if statement then my Compiler show that you are comparing between pointer and intiger and Then I can't get value from scanf function why please tell me.

6th May 2020, 4:48 PM
Yogesh Jangid
Yogesh Jangid - avatar
3 odpowiedzi
+ 1
Because although pointers are stored as integers, they are not actually so. You can just use the de-referencing operator to get the value stored in the pointer. *ptr_name [comparison_operator] int
6th May 2020, 4:56 PM
XXX
XXX - avatar
0
But I didn't use any pointer, I only use character variable, please explain me
7th May 2020, 4:26 PM
Yogesh Jangid
Yogesh Jangid - avatar
0
Please read what you have posted in your question. You have written 'Compare between pointer and integer'. To elaborate your question, please post your code here.
9th May 2020, 6:50 AM
XXX
XXX - avatar