|
-
May 20th, 2014, 03:25 PM
#1
Thread Starter
Hyperactive Member
What does * mean in C?
Code:
char *str="SONIA";
}
What does the above line means?
char *str--I guess by using * we can store more than one character in str.
I am right or wrong??
Please help me!!!!
-
May 20th, 2014, 04:14 PM
#2
Addicted Member
Re: What does * mean in C?
I believe it means Pointer
_____________
Tim
If anyone's answer has helped you, please show your appreciation by rating that answer.
When you get a solution to your issue remember to mark the thread Resolved.
reference links
-
May 20th, 2014, 06:03 PM
#3
Re: What does * mean in C?
In this context, char * str means a variable called str which is of type pointer to memory containing char. When used with initialization as in post #1, the chars S O N I A and the NULL char are placed in memory and str is allocated a value that is the memory address of the character S.
All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
May 21st, 2014, 03:55 AM
#4
Member
Re: What does * mean in C?
Last edited by CrazyBoy; May 21st, 2014 at 03:59 AM.
-
May 21st, 2014, 03:58 AM
#5
Re: What does * mean in C?
 Originally Posted by CrazyBoy
Pointer * means that the value is not saved in the variable itself. The variable keeps number which refers to the value saved memory. It is explained here:
That is C++ not C.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|