From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Help in my codes. Date: 16 Sep 2002 11:08:55 GMT Organization: Aachen University of Technology (RWTH) Lines: 33 Message-ID: References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1032174535 25429 137.226.32.75 (16 Sep 2002 11:08:55 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 16 Sep 2002 11:08:55 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Kim Seng wrote: > program13.cc:14: use of `count' is ambiguous > program13.cc:7: first declared as `int count' here > c:/djgpp/lang/cxx-v3/bits/stl_algo.h:320: also declared as `typename > std::iterator_traits<_Iterator>::difference_type std::count(_InputIter, > _InputIter, const _Tp&)' here I haven't even seen your code (don't UUencode source code, please...), but IMHO the error message is quite self-explanatory even so. Your program contains an error. It uses two things that conflict with each other: 1) a variable declared int count; 2) the statement using std; There obviously is an object 'std::count' in the STL headers. The 'using std' pulls that into your program's namespace, where it collides with your variable named the same. Solution: rename your variable, or get rid of that "using std". Better solution: get a an up-to-date C++ textbook that works with the final standardized language, not some outdated predecessor of it. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.