Appoint help: [modified]
-
I have to appoint an integer variable to another integer pointer itself. I tried this:
sNumber& DrawNumber() //pointer itself. { sNumber* pNum = new sNumber; pNum->i1 = edi1; pNum->i2 = edi2; } sNumber& sn = DrawNumber(); for(int i=0; i<2; i++) { int x1 = sn.pNum[i]; int x2 = sn.pNum[i]; }
How much its right or wrong? have you got other any bookmarks on this topic? I have no possibility to compile this codes. -- modified at 13:28 Wednesday 14th November, 2007Was is das¿
-
I have to appoint an integer variable to another integer pointer itself. I tried this:
sNumber& DrawNumber() //pointer itself. { sNumber* pNum = new sNumber; pNum->i1 = edi1; pNum->i2 = edi2; } sNumber& sn = DrawNumber(); for(int i=0; i<2; i++) { int x1 = sn.pNum[i]; int x2 = sn.pNum[i]; }
How much its right or wrong? have you got other any bookmarks on this topic? I have no possibility to compile this codes. -- modified at 13:28 Wednesday 14th November, 2007Was is das¿
-
I have to appoint an integer variable to another integer pointer itself. I tried this:
sNumber& DrawNumber() //pointer itself. { sNumber* pNum = new sNumber; pNum->i1 = edi1; pNum->i2 = edi2; } sNumber& sn = DrawNumber(); for(int i=0; i<2; i++) { int x1 = sn.pNum[i]; int x2 = sn.pNum[i]; }
How much its right or wrong? have you got other any bookmarks on this topic? I have no possibility to compile this codes. -- modified at 13:28 Wednesday 14th November, 2007Was is das¿
sNumber& DrawNumber() //pointer itself. What does "pointer itself" mean? Your function returns a reference { sNumber* pNum = new sNumber; pNum->i1 = edi1; pNum->i2 = edi2; You need to return a value from the function. } sNumber& sn = DrawNumber(); for(int i=0; i<2; i++) The DrawNumber function (supposedly) returns a reference to a sNumber object. How can you iterate through an array of two objects?? { int x1 = sn.pNum[i]; int x2 = sn.pNum[i]; There's no such thing as "pNum" here. } Pretty much none of this makes sense :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I'm going to have to go with it is a lot wrong, but can't say where because I have no idea what you are asking.
Well abase... You are mean that it is impossible to appoint an integer variable to an integer pointer. Anyone can help me?
Was is das¿
-
sNumber& DrawNumber() //pointer itself. What does "pointer itself" mean? Your function returns a reference { sNumber* pNum = new sNumber; pNum->i1 = edi1; pNum->i2 = edi2; You need to return a value from the function. } sNumber& sn = DrawNumber(); for(int i=0; i<2; i++) The DrawNumber function (supposedly) returns a reference to a sNumber object. How can you iterate through an array of two objects?? { int x1 = sn.pNum[i]; int x2 = sn.pNum[i]; There's no such thing as "pNum" here. } Pretty much none of this makes sense :) Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
Yeah how can i iterate thorough an array of two object. I just to mean that. So "sn" what has been refered to? What should i it to do? Can you help me? "The DrawNumber function (supposedly) returns a reference to a sNumber object." I can see it. Anyway I asked this question myself. I don't asking about this function does returns a reference to a sNumber object. [I just ask how can i appoint an integer variable to an integer pointer sn referred object.?] What do you say? it's no required? -- modified at 13:52 Wednesday 14th November, 2007
Was is das¿
-
Well abase... You are mean that it is impossible to appoint an integer variable to an integer pointer. Anyone can help me?
Was is das¿
Hakan Bulut wrote:
it is impossible to appoint an integer variable
What does "appoint" mean? Are you in school? Did they teach you that word? It's wrong, it is not a standard term used in software development. You need to learn the proper terminology and use it for text based communications to succeed.
-
Yeah how can i iterate thorough an array of two object. I just to mean that. So "sn" what has been refered to? What should i it to do? Can you help me? "The DrawNumber function (supposedly) returns a reference to a sNumber object." I can see it. Anyway I asked this question myself. I don't asking about this function does returns a reference to a sNumber object. [I just ask how can i appoint an integer variable to an integer pointer sn referred object.?] What do you say? it's no required? -- modified at 13:52 Wednesday 14th November, 2007
Was is das¿
Hakan Bulut wrote:
how can i iterate thorough an array of two object.
You need to have that array to begin with. I'm not sure where to start here....this is really C/C++ fundamentals that I'm not sure if you know or not. Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hakan Bulut wrote:
it is impossible to appoint an integer variable
What does "appoint" mean? Are you in school? Did they teach you that word? It's wrong, it is not a standard term used in software development. You need to learn the proper terminology and use it for text based communications to succeed.
led mike wrote:
What does "appoint" mean?
Right when I posted my first reply, I realized I forgot to ask that. :doh:
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hakan Bulut wrote:
it is impossible to appoint an integer variable
What does "appoint" mean? Are you in school? Did they teach you that word? It's wrong, it is not a standard term used in software development. You need to learn the proper terminology and use it for text based communications to succeed.
Sorry, I could not remember what was mean it in computers literature.
Was is das¿
-
Sorry, I could not remember what was mean it in computers literature.
Was is das¿
-
Hakan Bulut wrote:
it is impossible to appoint an integer variable
What does "appoint" mean? Are you in school? Did they teach you that word? It's wrong, it is not a standard term used in software development. You need to learn the proper terminology and use it for text based communications to succeed.
Assingment.. I just to mean assing a variable to an integer pointer itself where in the sNumber structure and to objective oriented these elements to using easy?.. Have you got an idea OOP method?
Was is das¿