|
-
October 19th, 2009, 08:14 PM
#1
character declaraton
why i can't declare my character string as
(char*) care=0;
and what is the mearning of
char& *care ? because i would like to define a pointer to char type that also is a reference.
thank you
-
October 19th, 2009, 11:50 PM
#2
Re: character declaraton
 Originally Posted by Dragon5
why i can't declare my character string as
(char*) care=0;
Well, the "(char*)" is not declaration. It's a casting operator.
-
October 20th, 2009, 07:44 AM
#3
Re: character declaraton
sorry but how do you know that ?
-
October 20th, 2009, 07:52 AM
#4
Re: character declaraton
It's part of the C standard (and hence works in C++, but there are other ways to cast in C++).
-
October 20th, 2009, 07:55 AM
#5
Re: character declaraton
i think it is atype definition and the compiler doesn't allow it to define like that
because
char a;
char*a;
only differentiates by an *
so i mean to comprehend why a pair of parentheses make such a difference to the compiler, how ?
-
October 20th, 2009, 07:58 AM
#6
Re: character declaraton
Because that's what compilers do? I don't understand what you are asking. Maybe you should back up a bit. What are you trying to do?
-
October 20th, 2009, 08:03 AM
#7
Re: character declaraton
 Originally Posted by Dragon5
i think it is atype definition and the compiler doesn't allow it to define like that
because
char a;
char*a;
only differentiates by an *
so i mean to comprehend why a pair of parentheses make such a difference to the compiler, how ?
Because that's how the language works.
You know the difference between your two declarations, right? One is a char, and one is a pointer.
You can declare char* a = 0 if you like.
-
October 20th, 2009, 08:04 AM
#8
Re: character declaraton
 Originally Posted by hoxsiew
I don't understand what you are asking. Maybe you should back up a bit.
what does "back up a bit" really mean ?
i have been waiting long enough to get such replies, my waiting time sure can be doubled till i get what i want.
ok, i won't lengthen this thread.
-
October 20th, 2009, 08:09 AM
#9
Re: character declaraton
I'm not trying to be deliberately obtuse, but I can't figure out what it is that you are asking? I thought a little background in your overall goal might help me understand your dilemma.
-
October 20th, 2009, 08:16 AM
#10
Re: character declaraton
 Originally Posted by Dragon5
what does "back up a bit" really mean ?
i have been waiting long enough to get such replies, my waiting time sure can be doubled till i get what i want.
ok, i won't lengthen this thread.
Sometimes when you're knew to the language and know a few tools or tricks, you want to apply that knowledge and make it work for every problem. Back up a bit means slow down a little, explain what you're trying to do and see if you're on the right track before plowing ahead.
-
October 20th, 2009, 08:32 AM
#11
Re: character declaraton
sorry i am bad at the language,
i can understand only the narrow meaning,
i have no idea of metaphor or word use to imply different things, that is why i ask him.
i think you and he share the same view and attitude over his own particular post toward me, which is quite odd but i won't care to ask for more.
-
October 20th, 2009, 08:34 AM
#12
Re: character declaraton
look at this http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B
it talks about operators. it should help you.
0100 0111 0110 1111 0110 0100 0010 0000 0110 1001 0111 0011 0010 0000 0110 0110 0110 1111 0111 0010
0110 0101 0111 0110 0110 0101 0111 0010 0010 0001 0010 0001 0000 0000 0000 0000 0000 0000 0000 0000
-
October 20th, 2009, 08:38 AM
#13
Re: character declaraton
Every1 here is to help you, dragon5
(char*) is language defined, such use to declaring object type is not allowed
-
October 20th, 2009, 08:39 AM
#14
Re: character declaraton
 Originally Posted by Dragon5
sorry i am bad at the language,
i can understand only the narrow meaning,
i have no idea of metaphor or word use to imply different things, that is why i ask him.
i think you and he share the same view and attitude over his own particular post toward me, which is quite odd but i won't care to ask for more.
Just trying to help. Your questions aren't exactly clear. Sometimes knowing more about what you're trying to do can help us get you a better answer.
-
October 20th, 2009, 08:40 AM
#15
Re: character declaraton
 Originally Posted by hoxsiew
I'm not trying to be deliberately obtuse, but I can't figure out what it is that you are asking? I thought a little background in your overall goal might help me understand your dilemma.
It's nice of you to "help" him
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
|