when I useĀ *ipĀ to initialize the pointer variable, | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

when I useĀ *ipĀ to initialize the pointer variable,

int x; int *ip; *ip = &x; Visual Studio gives an error: Error C2440 '=': cannot convert from 'int *' to 'int' Can someone please explain to me why i get this error?

19th May 2020, 11:36 PM
šŸŒ¹RamaršŸŒ¹
šŸŒ¹RamaršŸŒ¹ - avatar
2 Respostas
+ 4
Use ip = &x *ip dereferences and is used to access the value stored at the address held by the pointer ip.
20th May 2020, 12:06 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
20th May 2020, 2:53 PM
šŸŒ¹RamaršŸŒ¹
šŸŒ¹RamaršŸŒ¹ - avatar