* Problem with program :S
[not found] <e1e4a91b0807171344x2de6244coa6ec11fb4bceadcc@mail.gmail.com>
@ 2008-07-18 2:17 ` Luis Molina
2008-07-18 11:54 ` Philipp Thomas
0 siblings, 1 reply; 2+ messages in thread
From: Luis Molina @ 2008-07-18 2:17 UTC (permalink / raw)
To: gcc-help
Hello , I'm fixing a program for a guy that leave the company but I'm
having a lot of troubles.
For example
I have the class
struct foo {
int a;
char b;
}
struct Y{
fpos_t pos;
struct foo RECORD;
}
well something like that, if I do this
Y * REC
REC.pos=0L;
if (REC.RECORD.a !='1')
{
REC.pos+= sizeof(foo);
continue;
}
REC->pos=ftell(File);
I have errors like
error: no match for 'operator+='
error: no match for 'operator=' in 'REC->Y::pos = ftell(((X*)this)->X::FD)
All the errors come from the form he uses the equal, the ftell :S But
I dunno how to fix all
I tried something like
REC.pos+= (fpos_t) sizeof(foo);
But I don't know if it give me the same result :S
this one REC->pos=ftell(File) I don't know even how to fix it...
Thanks 4 all!
--
--------------------------------------------
^----^
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problem with program :S
2008-07-18 2:17 ` Problem with program :S Luis Molina
@ 2008-07-18 11:54 ` Philipp Thomas
0 siblings, 0 replies; 2+ messages in thread
From: Philipp Thomas @ 2008-07-18 11:54 UTC (permalink / raw)
To: gcc-help
* Luis Molina (lufemo@gmail.com) [20080717 22:46]:
> I have the class
>
> struct foo {
> int a;
> char b;
> }
>
> struct Y{
> fpos_t pos;
> struct foo RECORD;
> }
>
> well something like that, if I do this
>
> Y * REC
Either make that
Y REC;
a
or Y *REC = new Y;
> error: no match for 'operator+='
> error: no match for 'operator=' in 'REC->Y::pos = ftell(((X*)this)->X::FD)
You fail to state on which paltform and with which version of g++ you're
getting these errors. Fixing the obvious errors in the code fragments you
posted, I don't get either errors or warnings with gcc 4.2.1. So please post
a complete test case that reproduces theses errors.
Philipp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-18 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <e1e4a91b0807171344x2de6244coa6ec11fb4bceadcc@mail.gmail.com>
2008-07-18 2:17 ` Problem with program :S Luis Molina
2008-07-18 11:54 ` Philipp Thomas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).