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 19 20 21 22 23 24 25 26 27 28 29 30

<jamesd-> unless you use "byte" in the common sense of "octet".
<Alipha> it's so fun being in a channel with a bunch of pedantic programmers
<jamesd-> I find.
<stevieo> If you ain't pedantic your code blows chunks all over the maintenance programmers
<Stinger> if you are using non 8 bit byte machines you **** :P
<Stinger> there I said it
<Stinger> ;)
<stevieo> and proved to all...
<GraviSrvr> PC Engine \o/
<detrunco> does anyone know how to initialize a constant with the value returned from a function call?
<detrunco> or if its even possible
<Alipha> const int x = std::pow(3, 5);
<detrunco> can the same be done with a user defined function?
<NKD> const ipated = you
<Alipha> of course
<detrunco> hrm
<GenNMX> detrunco: There's no trick to it, you just can't re-initialize a const.
<Alipha> detrunco: why don't you paste your code? http://rafb.net/paste
<detrunco> ok
<detrunco> lemme put it up
<pantaloon> I'm working with a c++ dll on a pocket pc. I want to execute another application. I know I have used exec() with Java, what do I use with a c++ dll?
<GenNMX> pantaloon: Do you know the syntax of the functions contained within the dll?
<pantaloon> Yeah.
<detrunco> ok
<GraviSrvr> cant you just do a system() call?
<pantaloon> No worries I just want ot know what method to call.
<detrunco> I pasted all of what I thought was pertinent
<Alipha> the pocket pc uses windows ce?
<detrunco> if you need more, let me know
<Alipha> detrunco: url?
<pantaloon> It does.
<pantaloon> Do I just use one of the exec family of commands?
<Alipha> pantaloon: probably use LoadLibrary, GetProcAddress, and FreeLibrary
<detrunco> http://rafb.net/paste/results/vNi1Hz79.html
<detrunco> sorry, I haven't done this before
<bqk> what is the best online resource for learning c++ if you already know c and what is the best book to buy?
<GenNMX> pantaloon: Yeah, you need Windows CE libs linked for that then. It's not something "built-in" to C++ or part of the ANSI standard or anything.
<Alipha> detrunco: you'll notice that the errors are on lines 7-9, not 4.
<pantaloon> So some h files yeah.
<Alipha> detrunco: array sizes must be compile time constants (that is, the value of the constant is known at compile time)
<detrunco> ahh
<detrunco> that would be why the compiler kept saying they were size 0
<pantaloon> Oh I'm loading the library no problem.
<Alipha> detrunco: consider a std::vector instead. std::vector<int> stud_num(MAXSIZE);
<NKD> thats what I was going to say
<NKD> vector is more friendly
<NKD> and dynamic :)
<GenNMX> detrunco: This is because the program just says, "gimmie memory block 10354 through 10364" for an array of size 10.
<detrunco> ok
<Alipha> detrunco: or have the size be dynamic and just use std::vector's push_back instead
<GenNMX> The compiler, not the program
<detrunco> they only problem I foresee is that we haven't even touched something like the std::vector in cl*** yet
<GenNMX> pantaloon: I haven't done windows programming beyond DirectX, try #winprog
<Alipha> detrunco: you've used new[]?
<detrunco> does that create a dynamically sized array?
<Alipha> yes
<GenNMX> bqk: Depends on how much C you actually know. If you're a master in C, get an advanced C++ book. If you're a beginner in C, get a beginner C++ book. You get the idea. If you're a master in C, you can probably just use online references for C++ no prob, especially since almost everything you can do in C you can do in C++.
<detrunco> I think i'll do that
<detrunco> and then just use the constant for the rest of the program
<bqk> i wouldn't say i was a master, but i know c reasonably well
<bqk> whats a good url?
<detrunco> well, thank you all very much, you've been a great help
<bqk> someone is so going to say google
<bqk> ;)
<bqk> i though you might have a recommended one
<sculptor> bqk: www.mindview.org - free .pdf book (2 volumes)
<GenNMX> And why shouldn't I? Google works on the principle of in, out, and how many links to the site are found in their browsing of the Internet. A good site should have plenty of links to it.
<sculptor> or, is it .net ?
<NKD> http://mindview.net/Books/DownloadSites
<sculptor> it's .net, alright :)
<sculptor> bqk - you can buy 'c++ the programming language' - by Bjorne Stroustrup, the creator of C++
<NKD> the book ive been going through the past few days is the C++ Primer by Lippmann
<sculptor> Eckel's books are good if you know C already
<Raphael^^> :)
<Mxrcelus> Hey guys, Ive got a newbie question.. Whats the diference between "void main()" and "int main()" ?
<Indi_J> the first is not legal c or c++
<Indi_J> at least, not any more
<NKD> int main() will work fine, evne if you forget to set a return; line
<NKD> no reason to try and use void
<syle> how would you parse on a double delimiter? i tried strtok but it see a delimiter of // being valid for single /
<Mxrcelus> NKD, aw.. than its something like "int, u need to set a return line" and void u dont ?
<detrunco> quit
<sculptor> Mxrcelus - compiler inserts return 0; if you don't specify it
<sculptor> in C++
<sculptor> void main(... is invalid
<Mxrcelus> I know :) Im just trying to find a theoric diference between void and int. I need to explain that tomorrow in the cl*** :p
<X-Istence> Mxrcelus: there is a point to it
<sculptor> you can say: why typing 'void' when 'int
<sculptor> is shorter :)
<X-Istence> on certain systems they expect a return of something
<Mxrcelus> Hahah good point!
<X-Istence> so if you return a void pointer
<X-Istence> or a void
<X-Istence> it will try to read memory that it is not allowed to read
<X-Istence> and core dump
<Raphael^^> calc voidmain
<CalcMe> voidmain = void main(void) - the Wrong Thing - http://users.aber.ac.uk/auj/voidmain.shtml . Note this doesn't apply to C99 ( http://homepages.tesco.net/~J.deBoynePollard/FGA/legality-of-void-main.html ).
<X-Istence> There that was the page I was looking for :P
<Alipha> that first url gives a practical example of where void main can cause problems
<Mxrcelus> aw! Im gonna check this out. :p
<X-Istence> See, I could not find it in google
<X-Istence> tried to explain off the top of my head
<X-Istence> cheers Raphael^^
<_nx> by the way, about that copy_backward unsafe in vs 2k5 question from earlier, apparently you have to p*** a stdext::checked_array_iterator into that function for it to be safe. Also that error message can't be disabled AFAICT
<Raphael^^> :)
<_nx> hey raphie
<Raphael^^> hey :)
<Raphael^^> how are you?
<_nx> bored. I got signed up for a Windows Tech Day education hoohaw, and it was all high level marketing and business decision talks, no tech.
<Raphael^^> btw, I won't be at MS tomorrow
<_nx> aww
<Raphael^^> I forgot I have two microbiology exams
<_nx> so... you're still in school?
<_nx> I'd think that you'd OWN the school by now.
<Raphael^^> 8:30am, then a 9am meeting for work until 11am, then work, then cl*** at 1:30, then 4 hour exam at 2
<Raphael^^> I do both
<Raphael^^> I'll be f/t work only in jan
<Raphael^^> my last quarter
<_nx> ah
<Raphael^^> why don't you come to campus on thurs? bcc campus
<Raphael^^> we can go to lunch
<Raphael^^> in the cafeteria
<Raphael^^> but hey
<Raphael^^> lol
<_nx> sure, now where is BCC anyways?
<Raphael^^> it's right at 148th and 1-90
<Raphael^^> room N258
<Raphael^^> come right to my office
<_nx> okay
<_nx> noon?
<Raphael^^> http://www.bcc.ctc.edu/about/around/directions/maps/main-office.asp
<Raphael^^> N building is way off to the left on the map
<Raphael^^> yeah sure :)
<Raphael^^> lemme msg you my work #
<Raphael^^> there ya go
<bqk> nwd & sculptor: cheers
<sculptor> anytime
<Vova2> hey guys what is the difference between a function having a return type of: Node * or Node &
<sculptor> big one
<_nx> Vova, personal preference and cultural differences.
<syle> how can i use a double delimiter?
<_nx> specifically, don't use Node& if you could possibly return NULL.
<Vova00> they both mean the same thing ?
<Vova00> wierd
<_nx> no, but they are similar
<_nx> & was a C++ improvement, * is from C but is still widely used (and very useful)
<Vova00> ahh ok
<Vova00> :) thanks
<Vova00> so thats where the difference comes in
<ghled> so many Vovas


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

beginner
# of microbreweries in canada
archlinux
politics

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