+ 4

Char *message = "this is a message"; what is mean by this in c language???

16th Jun 2019, 1:08 PM
Gaurav Rawat
Gaurav Rawat - avatar
7 Réponses
+ 3
It is a pointer with a value "this is a message". The asterisk symbol (refereed as multiplication symbol *) is used to tell that it is a pointer and double asterisk is used to tell that it is a double pointer. Correct me if i am wrong !!
16th Jun 2019, 4:39 PM
Dhanesh Sivasamy
Dhanesh Sivasamy - avatar
+ 3
But pointer stores address. But there is a string store in pointer?im confused?
17th Jun 2019, 4:36 AM
Gaurav Rawat
Gaurav Rawat - avatar
+ 3
Pointers have variety of usefulness and comes handy in situations like 1) Direct Memory Access 2) Storing array 3) Provides a way to return to the function etc.., apart from the mentioned usages it can be also used to store alternate variables.
17th Jun 2019, 5:05 AM
Dhanesh Sivasamy
Dhanesh Sivasamy - avatar
+ 3
devanille Here, it isn't stored onto the heap, but on the stack.
17th Jun 2019, 7:45 AM
Théophile
Théophile - avatar
+ 3
Thanks a lot for the link!
17th Jun 2019, 4:42 PM
Théophile
Théophile - avatar