Re: Why do we get ambiguity errors in c++?

James Smith <[email protected]> Wed, 11 Feb 2009 10:07:49 -0800 (PST)
Newsgroups gmane.comp.programming.cppug
Message-ID <[email protected]>
Hi,

This might not work with the more certain compilers versions, but I had pro=
blems with this data-type conversion between char* and char[] years ago:



char
arr[] =3D =93 This is a string of characters =93;
puts(arr);
// This is equivalent to printing &arr
puts(&arr);
// This is equal to printing arr
//
( arr =3D=3D &arr ) is a true expression because, arr is an array not
a pointer

This leaves the variable arr not very well defined.
Is arr a pointer also, and if it is how can arr equal &arr if the
address operator takes its address.This is another conversion problem.


Thanks,
Jim Smith



--- On Wed, 2/11/09, manish gupta <[email protected]> wrote:
From: manish gupta <[email protected]>
Subject: Re: [cppug] Why do we get ambiguity errors in c++?
To: [email protected]
Date: Wednesday, February 11, 2009, 8:27 AM











=20=20=20=20
            I think, by standard you can not overload a function with premi=
tive data types.



Thanks,



Manish.



"Don't Limit Your Challenges.. .Challenge Your Limits"



:)



--- On Wed, 11/2/09, Harvinder <me_harvinder@ yahoo.com> wrote:

From: Harvinder <me_harvinder@ yahoo.com>

Subject: [cppug] Why do we get ambiguity errors in c++?

To: cppug@yahoogroups. com

Date: Wednesday, 11 February, 2009, 3:24 PM



Hi everyone can anyone tell me



if i give=20



int sum(int,int) ;



int sum(float,int) ;



int sum(float,float) ;



int sum(int,float) ;



prototypes in a pgm and give a call to sum(2,3.4);



Then an ambiguity error comes between sum(int,int) and sum(int,float) ;



WHY???



Add more friends to your messenger and enjoy! Go to http://messenger. yahoo=
.com/ invite/



[Non-text portions of this message have been removed]



=09

=09=20

=09

=09



=09



=09

=09



Connect with friends all over the world. Get Yahoo! India Messenger at http=
://in.messenger .yahoo.com/ ?wm=3Dn/



[Non-text portions of this message have been removed]




=20

=20=20=20=20=20=20

=20=20=20=20

=20=20=20=20=20=20=20=20=20=20=20
=20=20
=20=20=20=20
=09
=09=20
=09
=09








=09


=09
=09


=20=20=20=20=20=20

[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/cppug/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/cppug/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected]=20
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/