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

Started by
20 comments, last by Coz 21 years, 5 months ago
Anybody now what''s wrong with this code? if(Temp == VertexNumber) File.getline(Word,50,'','');//EOL else File.getline(Word,50,'';'');//LAST EOL
Advertisement
And the error you are getting is what?

|.dev-c++.|.the gimp.|.seti@home.|.dbpoweramp.|.torn.|.=w=.|
shouldn''t you reference Word? as in &Word?

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Perhaps you could tell what it''s supposed to do, what it does instead, and some more context (what types, classes etc.)?
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
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
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
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.
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]
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.
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]

This topic is closed to new replies.

Advertisement