Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Coz

Anybody nows what's wrong with this code?(4 lines)

This topic is 5728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anybody now what''s wrong with this code? if(Temp == VertexNumber) File.getline(Word,50,'','');//EOL else File.getline(Word,50,'';'');//LAST EOL

Share this post


Link to post
Share on other sites
Advertisement
Perhaps you could tell what it''s supposed to do, what it does instead, and some more context (what types, classes etc.)?

Share this post


Link to post
Share on other sites
quote:
Original post by Crispy
shouldn''t you reference Word? as in &Word?


That would not be a reference - that would be the address-of operator.



God puts an apple tree in the middle of the Garden of Eden and says, do what you like guys, oh, but don''t eat the apple. Surprise surprise, they eat it and he leaps out from behind a bush shouting "Gotcha." It wouldn''t have made any difference if they hadn''t eaten it... because if you''re dealing with somebody who has the sort of mentality which likes leaving hats on the pavement with bricks under them you know perfectly well they won''t give up. They''ll get you in the end. -- Douglas Adams

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
That would not be a reference - that would be the address-of operator.

He used "reference" as a verb. I think that it''s quite valid to say that a pointer is referring to an object.

For example, the C++ FAQ Lite uses the term "reference semantics" to designate both pointers and references.

Cédric

Share this post


Link to post
Share on other sites
Thanks people i already fixed the error and it wasn''t that but other lines of code that were directly related to the ones i posted.

Share this post


Link to post
Share on other sites
quote:
Original post by Arild Fines
That would not be a reference - that would be the address-of operator.


The & is also called the reference operator, just like the * is called the dereference operator.

The reason he doesn't have to pass the address of Word is because it's probably the name of an array. It implicitly passes the address of the first element.

[edited by - Matt Calabrese on November 10, 2002 7:30:19 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Matt Calabrese
The & is also called the reference operator

There''s no such thing in C++ called the "reference operator". It''s called the address-of operator.

Share this post


Link to post
Share on other sites
quote:
Original post by SabreMan
There's no such thing in C++ called the "reference operator". It's called the address-of operator.


In C there was nothing referred to as the reference operator, but in C++ the name "reference operator" is commonly used.
It's commonly called the "reference operator" in C++. Look it up.

http://cs.nmhu.edu/personal/curtis/cs1htmlfilesPre8-2001/essentialssec10.htm#refOper

Is one I came across rather quickly in google.

EDIT: Some people even referred to it as the reference operator in C.

This reminds me of thread where you said I was wrong for calling a member function a method. It's just 2 words for the same thing. Maybe originally it was only called the addres-of operator, but that is no longer the case.

[edited by - Matt Calabrese on November 10, 2002 7:40:37 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!