![]() |
|
#1
|
|||
|
|||
defining a struct inside a class :(1-Ive defined a class and inside that class ive defined a struct to create a new type, there are a few member functions in the class . these functions return a number of the structs type(sorry if the phrases I use aren’t correct,.....) anyway what I was wondering is this, what is the function definitions format ?
Isn’t it supposed to be like this: CPP / C++ / C Code:
"error C2556: 'struct complex __thiscall complexc::make_complex(double,double)' : overloaded function differs only by return type from 'struct complexc::complex __thiscall complexc::make_complex(double,doub" (if I delete the bold part then I don’t get the above error but I get a whole bunch of new ones.......) I have no idea why I get this error, I haven’t over-loaded any function(assuming I’ve understood exactly what function-overloading is ) Off-course I know that if I over-load a function then the function’s parmeters have to differ with one another, ......but the problem is I haven’t overloaded any functions. 2- if one of these member-functions was supposed to call another member-function then how does it do that?(I want the format) Please reply as soon as possible. |
|
#2
|
||||
|
||||
|
Without seeing actual code and all error messages, I can not be 100% certain.
However, probably you have left out the scope from the return type. Since the struct is declared in the class, outside the class the symbol may not mean anything (or if it does, probably it means something else). For example, CPP / C++ / C Code:
Not sure how to answer your second question without more details of what you have tried so far and where it seems to go wrong. Matthew |
|
#3
|
|||
|
|||
|
Quote:
thanx, it seems thats exactly what i haven't done.(my so-called tutor never said anything !!!) lemme go work on that and see if i get any more errors. kai85. |
Recent GIDBlog
Observations of Iraq by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2D arrays:dynamic allocation and freeing | bravetanveer | C Programming Language | 48 | 27-Nov-2007 15:55 |
| Urgent ! Pls Help Me ! | mycashmoney | C Programming Language | 4 | 01-Jul-2006 22:49 |
| [Tutorial] GUI programming with FLTK | dsmith | FLTK Forum | 10 | 03-Oct-2005 15:41 |
| Error C2146: syntax error : missing ',' before identifier 'C4' | mattchew008 | C++ Forum | 2 | 19-Dec-2004 06:06 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The