Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to overload functions?

Featured Replies

Dunno really know if this here is overloading, but anyway. How can I 're'-define a function, e. g. having funct(a,:( and funct(a,b,c,d) at the same time.Just a redefinition likevoid funct (char a, char :({ bla bla}void funct (char a, char b, char c, char d){ even more bla}doesn't work for me. MinGW kicks out some errors like "previous declaration of funct" or something like that.Etienne :-wave

Try C++ not C for illegal re-definitions or what is it called "overloading?". If you want a function wth varibale parameter list try to define it with ..., but I don't recommend it. Chose different function-names and that's all, where is the problem?Arne Bartels

Yup what I wanted was several functions with different parameters but the same function name (e. g. like most of the GDI+ functions).>Chose different function-names and that's all, where is the>problem?Nah, no problem really, just wondered if it was possible in plain C to achieve the above.Thanks,Etienne :-wave

Hm, I just remembered that in plain C it is impossible to overlaod functions as fara as I know. But, if you write C-style functions in .cpp files, function overloading is possible. Since all compilers do C++ compilation if used with .cpp files it is C++, even if the function style is still C.Arne Bartels

Ok, thanks a lot, this might indeed work. :-) One dumb question though - how to tell the MinGW makefile to compile e. g. SDK.cpp instead of SDK.c? In the makefile there is specified GAU_NAME=SDK for example, without any file extension. Didn't really get it to compile SDK.cpp.Thanks again,Etienne :-wave

Have a look further down where GAU_NAME is really needed. Is there an extension? Fine, replace it.Arne Bartels

WHOOOPS *hiding in corner*I better should have had a deeper look once into makefile.Along with hundred thousand new warnings about conversion sutff (not too important for now), one error though I can't seem to get fixed:somegauge.o(.eh_frame+0x11):somegauge.cpp: undefined reference to `__gxx_personality_v0'Thanks man! ;-)Etienne :-wave

Maybe a library you forgot to add to the ADD_LIBS section? I have never seen this reference before. Is it a function you defined yourself?Arne Bartels

Hmmm, no.Seems to be just the result of changing to CPP. Also getting thousands of warnings about conversions now. That all with the overloaded functions commented out by the way.

Strange. Personally I prefer not to use "everything in one" file especially with cpp files. I posted an example of a splitted SDK sample recently here. To get it to work with GCC it needs a bit of work on the makefile, though.If I recall that right you need ADD_OBJS line like:ADD_OBJS=SDK.Attitude.o SDK.Control_Surfaces.o SDK.Fuel.o SDK.Fuel_Selector.o SDK.Temperature.o SDK.Wiskey.oI also changed $(GAU_NAME).o: $(GAU_DEPS) $(CC) $(CFLAGS) -o $@ -c $

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.