Help Logs Database

Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Ircnet  |  Dalnet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

<kick***_6> how can I implement optional parameters? I am trying int y=-1 in my function declaration but it doesnt seem to work
<Joge> void f(int = 3); void f(int i) { ... }
<kick***_6> thats what I am doing but it doesnt seem to work.
<Joge> then u can call it f(); and i gets value 3
<kick***_6> void f(int = 3); void f(int i) { ... } you mean void f(int i=3) correct?
<jeffmir> the default value can appear either in the decleration or the definition (usually the decleration is preferred) but not both
<kick***_6> I am doing it in the declaration
<jeffmir> the formal parameter does not need to be named
<kick***_6> void fillBasketFromFile(std::ifstream & listInputStream, Basket* myBasket, int personsMaxCapacity=-1); --> then I call it by simply fillBasketFromFile(listInputSteam,myBasket) and it fails :S
<jeffmir> ie voidf(int=0); is fine
<Joge> kick***_6: i think it should not fail
<kick***_6> it is.
<Joge> are you sure the error is in that param?
<jeffmir> well is myBasket a pointer ?
<kick***_6> yep
<kick***_6> says it cant find the function, when I simply remove the =-1 and p*** in a -1 it works fine
<jeffmir> well then the caller doesnt see the decleration of your function with the default parameter
<jeffmir> its likely below the definition of the function (which doesnt specify the default)
<kick***_6> nevermind it isnt liking me p***ing in the myBasket*. from a Basket object method, I p*** "this" for that parameter, appears that is invalid.
<hotnikks> what is the preferred way to access mysql dbs from within c++?
<einride> fopen() !
<hotnikks> heh
<hotnikks> funny, which api? :P
<einride> what do you prefer?
<einride> personally i use the c client api
<kick***_6> any reason why "this" wouldnt work to p*** in that object?
<hotnikks> i havent used any of them yet
<hotnikks> mysql++ looks like the preferred api?
<YUY0x7> kick***_6 what do you mean
<YUY0x7> ?
<einride> preferred by who?
<einride> the c api is preferred by me!
<hotnikks> hah
<Joge> postgresql > mysql
<Joge> do u agree that? o/
<hotnikks> meh
<kick***_6> I have a method in Basket that needs to p*** its pointer (the basket object) to another function. How would I p*** that pointer of the current object? I attempted this but it fails.
<einride> kick***_6: define "fail"
<kick***_6> it doesnt like it when I p*** into the function.
<kick***_6> as it wont compile.
<hotnikks> you cant p*** "this" ?
<einride> ok progress, "can't compile"
<einride> now show us teh code!
<einride> (and don't paste it here :P)
<kick***_6> fillBasketFromFile(listInputStream,this); into this function of void fillBasketFromFile(std::ifstream & listInputStream, Basket* myBasket, int personsMaxCapacity=-1);
<YUY0x7> what's the error?
<kick***_6> the first call is made from a myBasket object.
<kick***_6> failing argument dependent lookup
<YUY0x7> paste the actual message
<kick***_6> \\fs02\brutledg\NexusMyDocuments\Visual Studio Projects\CS246_***ignment2\Basket.cc(95): error C3861: 'fillBasketFromFile': identifier not found, even with argument-dependent lookup
<einride> so that part of your code can't see fillBasketFromFile. lacking some headers?
<hotnikks> theres your problem
<hotnikks> youre using visual studio instead of vi
<hotnikks> shame on you
<einride> shame on whoever argues for a specific toolchain instead of picking what suits the job.
<YUY0x7> the problem is not visual studio :P
<hotnikks> yes im kidding :)
<kick***_6> and its an issue with the optional param it seems cause even this fails fillBasketFromFile(listInputStream,new Basket());
<YUY0x7> no, include the header that declares that function
<einride> kick***_6: "identifier not found". it doesn't see your fillBasketFromFile. do you need to include a header file?
<kick***_6> I have the header file that declares that function already included
<einride> kick***_6: now paste some more code, at the paste site. this is like a mechanic trying to diagnose a car problem on the phone with your grandma.
<kick***_6> oh ****, I didn't in the one file.
<YUY0x7> unlikely.. is it in some other namespace?
<kick***_6> I moved it and forgot the include. had to move it cause i didnt want it to be in main.cc cause my markers my replace that on me and that wouldnt be cool.
<Mister_X> ++ all
<Soronel> YESSSSSSS
<czth> yess! you finally got ++'d
<jeffmir> im getting very pissed at linux documentation
<czth> geez, i had module inits 4 years ago
<czth> :P
<jeffmir> i hope your os is better soronel
<jeffmir> lets see your docs
<czth> heh, docs
<Soronel> czth: I had it working a couple months ago, but then decided to make my core modules be loaded dynamically
<czth> jeffmir: what docs are you looking for?
<czth> Soronel: what filesystems do you have so far?
<Soronel> czth: so my module init call is after relocation
<Soronel> czth: a stripped fat12 for the disk image, my modules themselves are stored in a .ar
<jeffmir> SIOCGIFENCAP
<czth> i had ext2, i knew fat well enough to implement it, but that was around when i was quitting because i didn't feel i could learn any more
<Soronel> got rid of date and some other information from fat12, so each directory entry is 16 bytes
<jeffmir> but first i need to determine how i can go from an interface name to a fd easily
<czth> SIOwhat?
<jeffmir> and then how do i interpret the int that ioctl returns
<jeffmir> im forced to dig through the crappy net-tools c code ...
<Soronel> and now it's time to go watch USC
<jeffmir> im still fuxoring with enumerating all ethernet network interfaces on a linux box
<czth> rtfkernelsource
<czth> if it's crappy, clean it up and send in a patch
<Cray-on-> ey guys
<Cray-on-> quick question
<Cray-on-> if i compile my program in dev-cpp, it gets like 500kb
<Cray-on-> 23 lines of codes
<Cray-on-> anyway to make it smaller?
<Cray-on-> i think someone told me about some debugg info that could be turned off or something
<mrmister_> soronel: are you
<binrapt> Cray-on- hmm I think it always was +450 KiB when I included iostream, hilarious
<YUY0x7> Cray-on-, yeah... put it in release mode .. i dont know how it's done in devc++
<Cray-on-> YUY0x7 thx, i'll look for it
<Cray-on-> another question, if i code for console and want a part of a text show in green
<Cray-on-> is that possible
<YUY0x7> not standard
<YUY0x7> in windows, SetConsoleTextAttributes or something
<Cray-on-> sounds complex
<zenogais> Cray-on-: its just the Win32 API, most simple things are somewhat complex ;)
<Cray-on-> ;P
<Cray-on-> sigh, really cant find that release mode thingie
<YUY0x7> google?
<Cray-on-> na
<Cray-on-> reading the manual
<YUY0x7> maybe it's not called release
<YUY0x7> look for debug information or things like that..
<jeffmir> _m_ are you awake?
<jeffmir> http://rafb.net/paste/results/w9C1lm61.html it ****ing prints the same encapsulation result for all the interface :(
<jeffmir> oh maybe i need to close the socket after each use so it can bind to the next interface correctly
<jeffmir> nope ,same crap
<Joge> jeffmir: wanna participate in some cool programming project with me :I
<Joge> can i participate in ur projects?
<Jey> what is an "encapsulation result"?
<zenogais> Jey; the result of encapsulation
<Jey> ohhhhhhhh
<Jey> ok
<zenogais> :P
<Jey> yay
<Jey> now i need calc
<BunkaiSR> there is a simple c++ parser. Its name started with C..... Does anybody recalls its name please?
<BunkaiSR> I mean C++ XML parser
<zenogais> BunkaiSR: there's one called simplexml iirc
<Jey> expat is the standard one
<einride> is there a standard xml parser?
<BunkaiSR> zenogais, hello.. thanks.. there are so many ones...
<BunkaiSR> einride, do you have time to talk about xerces, please?
<zenogais> xerces is hard to work with
<BunkaiSR> zenogais, yeah... for example, I have difficulties to work with windows.h
<BunkaiSR> under xerces
<tigerhart> I have a question, while on the subject of XML, I was looking at an XML project that I was thinking of doing but the only problem, is the GUI I am going to need... I have no idea how to create. Anyone know where I can find information/tutorials on 'split windows' I guess you'd call it?
<zenogais> tigerhart: in the Win32 API?
<tigerhart> like most GUI WYSIWYG HTML editors have? IE Code on top, rendered on bottom, other windows on the sides, etc...
<BunkaiSR> einride, can I PM you please?
<tigerhart> I dunno exactly if it's just on the GUI side, or API side.
<BunkaiSR> jey, do you know expat?
<einride> BunkaiSR: find yourself some sample source... xerces takes a bit getting used to, but it works fine
<zenogais> tigerhart: look up WTL, easiest way to make Windows GUIs IMO
<Jey> BunkaiSR: i've used ti
<Jey> einride: de facto standard :)
<einride> haha
<BunkaiSR> einride, is it possible to use windows.h, and time.h, and other includes in xerces, please? I experiment with included samples, but can not implement those mentioned


Return to c++
or
Go to some related logs:

politics
rock

c++

Copyright © 2005 www.irclogs.ws. All rights reserved. » disclaimer » contact