Club409

The best damn waste of time!

Calling on you computer nerds

Steven
Total posts: 751
on a related note say in the body of myFun i make a call to some other function. will that function call look for C++ function (with name mangling and such) or will it look for a C function (since the function is declared inside an extern "C" block)?
mwinter
Total posts: 4314
(Updated 12/7/2009 9:49 AM)
Why do you need (want?) to overload stuff?a little internet searching informed me you can use the unix cmd line "nm" on your object files to see what the internal (mangled) names are so perhaps that could be helpful i dont have much fortran experience =[As for calling other methods.. you can call static C++ class methods from C code which can in turn call member functions. Example:
class Foo {public:  static const Foo* getInstance();  static void releaseInstance();  // To be called from your extern "C" { ... }  static int staticBar();  // To be called on our singleton  int memberBar();private:  // These are private to enforce singleton behavior  static Foo* singletonInstance;  static int references;  Foo();  Foo(const Foo &toCopy);  virtual ~Foo();  Foo &operator=(const Foo &toCopy);}; // end class Fooconst Foo* Foo::getInstance(){  if(singletonInstance == NULL)  {    singletonInstance = new Foo();  }  ++references;  return singletonInstance;}void Foo::releaseInstance(){  --references;  if(references == 0)  {    delete singletonInstance;    singletonInstance = NULL;  }}int Foo::staticBar(){  Foo* aFoo = getInstance();  return aFoo->memberBar();  releaseInstance();}int Foo::memberBar(){  // Do some fancy calculation  return 4;}
mwinter
Total posts: 4314
I guess for a more direct answer to your "what will be called from myFun()" question -- you don't have to figure out what name it'll have it should match what you named it in your C++ stuff. However if you're using classes you can't call member functions -- you have to call static ones.
Steven
Total posts: 751
thanks for the assistance i think i should be able to make it work from that.the reason for all of that is a project i'm working on with oak ridge. i'm adding some functionality to one of their codes (primarily in C++) which is (theoretically) being made easier by using a readily available software package from some mathematician which is written in fortran. that code interfaces to the outside world via hard-coded function calls so i have to make the C++ code match up with those calls. if this was for my own use i would just modify the fortran code to make it interface easier. but oak ridge can't legally distribute the fortran code to users so all users will have to download the fortran program on their own so i pretty much need it to work without modification to that package.
mwinter
Total posts: 4314
Underhanded C Competition -- get on it
ezmac102
Total posts: 1045
(Updated 7/7/2010 6:06 AM)
so i need to sign up for internet service. the girl next door wants to share which i'm totally down for. i haven't talked to her about whether or not she wants a bundle with cable or phone but i just want internet. so i wouldn't prefer comcast sicne they are the worst company in the world but i thought i'd get your opinion on the matter. i briefly looked at Clear internet which you guys seem to like well enough. but i thought i'd also get you guys to tell me if any of these Comcast packages are any good (I don't know what any of those numbers mean).
ezmac102
Total posts: 1045
ps-what happened to my avatar? i can't see it on my computer...
mwinter
Total posts: 4314
(Updated 7/7/2010 6:06 AM)
yeah i dont know what's going on with that the avatar doesn't show up for some posts. it's happened before and i can't seem to find a problem =[oh in that case you have an unclosed link i'll fix it posthaste
mwinter
Total posts: 4314
(Updated 7/7/2010 6:28 AM)
for the Comcast one you have to put in an address and I have yours but i wont post it here :)edit: so i looked at the options for Comcast and Clear and it pretty much comes down to these 4 options:
  • Comcast
    • "Performance" 15 down 3 up 6 months @ $19.99/mo then $42.95/mo
    • "Economy" 1.5 down 0.384 up $24.95/mo (no intro price)
  • Clear
    • Basic Home 1.5 down 0.5 up $30/mo
    • "Get One" Home 6 down 1 up $40/mo
    The Clear options have either a 2 yr contract or a $35 activation fee for month-to-month plans.For Comcast the download speeds on the performance plan are not very accurate. "Actual speeds vary and are not guaranteed. PowerBoost provides bursts of download and upload speeds for the first 10 MB and 5 MB of a file respectively." Which means if you're downloading anything bigger than that then you'll most likely see more like 6 down 1 up.All of these measurements are in Mega bits per second not Mega Bytes.No matter what plan you choose I've got an extra Clear mobile USB dongle that I'm paying for and not using. So if you want to have access anywhere in Seattle on your lappy toppy you can use my dongle for the low low price of $5 a month. And depending on your actual internet usage that may be enough.. but probably not if you're a hulu junkie.
acelxix
Total posts: 2394
(Updated 7/7/2010 6:44 AM)
You probably didn't close your link correctly so it borked your avatar tsk tsk. (edit: knew it!) :DOver all Clear has been pretty good. The service cuts out for no reason occasionally and requires the modem to be reset but customer service was excellent whenever I did have issues. It seems like clear coverage in seattle is decent but make sure your address is in a good signal area before you sign up. Go by a store and ask to do a trial and they'll let you try the modem out at your house for a few days so you can test the signal strength. Unfortunately the rate is now $55/month which is about what you'll pay for comcast if you just get internet.Also keep in mind that you'll probably have to sign a two year contract so make sure the girl next door is going to stick around for that long otherwise you might end up having to pay for the whole thing on your own. Just make sure they explain the contract in detail before you sign up. We've been f'd over so many times now because we didn't read the fine print.Comcast does have a 6month for $20 deal and then the rate goes up to $42-60 depending on your area. If you want more bandwidth and don't mind shitty customer service and really long wait periods (it'll probably take 2 weeks for them to come out and setup the service and it can take weeks before they come out to look at a problem with the service) go with comcast. If you want internet right now good customer service with minimal outtages then go with clear.I'd recommend going with Clear.edit: matt's dongle is always the best choice. no contract $5/month use it where ever you need. Of course going with that option screws the girl next door but that wouldn't be a first for matt's dongle. heyoo!