• What Are You Working On? V13
    5,003 replies, posted
Oh, it's 'Beginning Programming in C++ for Dummies'
[QUOTE=Cittidel;25821836]Oh, it's 'Beginning Programming in C++ for Dummies'[/QUOTE] Might I recommend the website, [url]http://learncpp.com[/url] ? Its not exactly a whole-language cover (but really, what is) but it really teaches the basics of the language well, object oriented programming, arrays, pointers, etc
[QUOTE=Whitewater;25821939]Might I recommend the website, [url]http://learncpp.com[/url] ? Its not exactly a whole-language cover (but really, what is) but it really teaches the basics of the language well, object oriented programming, arrays, pointers, etc[/QUOTE] Gladly, I appreciate the help, there's just so much to learn, it's exciting!
[QUOTE=Cittidel;25821836]Oh, it's 'Beginning Programming in C++ for Dummies'[/QUOTE] For dummies, by dummies :v:
[QUOTE=shill le 2nd;25822397]For dummies, by dummies :v:[/QUOTE] Would you recommend [url]http://www.learncpp.com/[/url] as well then?
I've never used it. I used [url]http://www.cplusplus.com/[/url] to learn, but then again I already kinda knew C so I didn't need a complete beginner tutorial. [url]http://www.learncpp.com/[/url] looks quite good though; I see it teaches all the concepts of what's going on behind the scenes before it actually starts you off coding. It looks very structured.
Turns out that trying to get Tcl to work as the preprocessor is harder than I thought. I tried it with Lua, as well. Talk about a roadblock. :sigh:
My first C++ Site was: [url]http://www.cplusplus.com/doc/tutorial/[/url] Idk. I got off pretty well. I'm not quite sure what's being disagreed with, but hell, to each his own I suppose.
[QUOTE=Chris220;25812472]I was taught SOH CAH TOA (pronounce it phonetically as "sohcahtoa")[/QUOTE] Oh wow, really? I would never have guessed! [editline]3rd November 2010[/editline] [QUOTE=-Ana;25813846]Does anybody know if it works to pass a cookiecontainer from a function to function?[/QUOTE] Yeah, it's a reference type which means passing it around will pass the same object around. [sp]i have a lot of experience with CookieContainer :v:[/sp]
[QUOTE=ZeekyHBomb;25813999][url]http://www.daniweb.com/forums/post438070.html#post438070[/url][/QUOTE] Ah, I never knew that :) [editline]3rd November 2010[/editline] [QUOTE=Icedshot;25813562][img_thumb]http://i55.tinypic.com/20ggwg3.png[/img_thumb][/QUOTE] :v:
I just did this: [img]http://ahb.me/PMA[/img] And this (inspired by Chandler's hue, but for .NET): [img]http://ahb.me/PLB[/img] Which can also be used like so: [img]http://ahb.me/PLQ[/img] If anyone's interested, let me know and I'll post source for you.
I'm currently just messing around with clang's blocks, and templates. Turns out, some specialization is needed to handle templates with "void" parameters. [cpp] #include <iostream> template <typename T, typename U> T function(T (^block)(U)) { return block(); } template <typename T, typename U> T function<T, void>(T (^block)(void)) { return block(); } int main(void) { typedef void (^block)(void); block my_block = ^(void) { std::cout << "Hello, World!" << std::endl; }; decltype(my_block) z = ^(void) { std::cout << "Yes, it works!" << std::endl; }; my_block(); z(); function<void, void>(^(void) { std::cout << "Now this is a closure!" << std::endl; }); std::cout << function<int, void>(^{ return 42; }) << std::endl; /* supah fly~ */ function<decltype(z), void>(^{ return ^{ std::cout << "Hello, Facepunch!" << std::endl; }; })(); } [/cpp] As of right now, this is the only way to have any kind of lambda function on OS X, or FreeBSD, as the GCC versions on there are quite old (4.2.1). Luckily, however, the new decltype keyword has no need for runtime support, so as long as you have a recent version of clang, you'll be able to use it. (Which luckily makes my life easier, as I can now do a bit more when it comes to types).
[QUOTE=bootv2;25825138]oh c++ for dummies is bad? that explains why learning with that book was so hard. and I've experienced some of the algorythms they explained wouldn't compile. does one of you know a book to fall back on?[/QUOTE] I learned with C++ for dummies and there wasn't a single example that didn't work. You've done it wrong. It's not a bad book really. There may be better ones but honestly there wasn't anything really wrong with it.
still new at C++ classes, How would i make my own sprite class inherit from SFML's sprite class? or should i doo it a different way? [editline]3rd November 2010[/editline] BTW jut got my free copy of develop :D so all that signed up earlier should receive yours [editline]3rd November 2010[/editline] BTW jut got my free copy of develop :D so all that signed up earlier should receive yours
[QUOTE=ZeekyHBomb;25814057]What are those triangles and that single red line behind the actual 'shadow shapes'? [editline]2nd November 2010[/editline] mah automerge :argh: [editline]2nd November 2010[/editline] mah automerge :argh:[/QUOTE] The red triangles are where the sections of the circle shouldnt be displayed. The single red line is actually a triangle in memory, but im not drawing the last (y) line of the circle as the way im doing this means that occasionally you dont get that last row being chopped all the way down, so just looks better like this. Anyone want the (abysmal) sauce?
[QUOTE=xAustechx;25818113]What's wrong with that? The point of the text behind it is to filter out what is what. That way I can easily grab what's in the file. For example, when I want to log in, I check if the hash values both match, like so: [code] if($pass == getFieldVal($user, "pass:")) { //Do stuff } [/code][/QUOTE] I think he meant your example MD5 hash came from the word "password".
[QUOTE=Richy19;25827401]still new at C++ classes, How would i make my own sprite class inherit from SFML's sprite class? or should i doo it a different way? [editline]3rd November 2010[/editline] BTW jut got my free copy of develop :D so all that signed up earlier should receive yours [editline]3rd November 2010[/editline] BTW jut got my free copy of develop :D so all that signed up earlier should receive yours[/QUOTE] You may or may not want to inherit from SFMLs sprite class. The simple answer is yes go ahead and do it. But you haven't told us what kind of class you are trying to make so we can't give you specific object oriented design help. But if you are interested in the design side of it and when/when not to use inheritance google some stuff like: composition, inheritance vs composition, LSP.
[QUOTE=r4nk_;25827655]You may or may not want to inherit from SFMLs sprite class. The simple answer is yes go ahead and do it. But you haven't told us what kind of class you are trying to make so we can't give you specific object oriented design help. But if you are interested in the design side of it and when/when not to use inheritance google some stuff like: composition, inheritance vs composition, LSP.[/QUOTE] Basically if i inherit from it i will already have the main bits like the moving, the sprites image... And i then just have to add things like life, attack, and any other thing like that. But yea il google it up Also should i make a tile class for all the tiles? at the moment im just using a sprite class for the tiles and the trees.
[QUOTE=Richy19;25827782]Basically if i inherit from it i will already have the main bits like the moving, the sprites image... And i then just have to add things like life, attack, and any other thing like that. But yea il google it up Also should i make a tile class for all the tiles? at the moment im just using a sprite class for the tiles and the trees.[/QUOTE] Oh you want some sort of entity class. I would use composition instead (keep an sfml sprite as a member variable). The way you say it, you sound like you want to use inheritance solely for code reuse which is usually a pretty bad idea (google public ('is-a') and private inheritance). As a general rule, use composition for has-a relationships not private inheritance unless you have to. I don't know what your project is but a good start might be to have a level, which has a map and maps have an array of tiles. Tiles can use inheritance to represent the different tile types, but a tree and grass tile can both be represented by the same simple tile class.
[QUOTE=Cittidel;25821686]I know that this doesn't really compare at all to everything thing else here, but I'm really happy that I started to learn programming, I'm starting with c++, and I like it a lot. (I'm obviously learning from a book) [img_thumb]http://imgur.com/1OzJN.png[/img_thumb][/QUOTE] [quote]goto[/quote] :psypop:
[QUOTE=BlkDucky;25829200]:psypop:[/QUOTE] There are so many things wrong with it, including using c headers, global namespace pollution, _tmain, goto, indentation and no return value.
This is why I don't want to learn C++
What why? because assholes are allowed to publish books?
Most times I see people posting their code here they just get ripped open and it all seems so elitist
But the feeling you get once it is complete is great as you have had to do EVERYTHING yourself and not have half the language do it for you
[QUOTE=NovembrDobby;25829450]Most times I see people posting their code here they just get ripped open and it all seems so elitist[/QUOTE] We aren't ripping his code apart, it's the book that's fundamentally wrong.
[QUOTE=NovembrDobby;25829450]Most times I see people posting their code here they just get ripped open and it all seems so elitist[/QUOTE] "their code"? They copied it out of a book.
[QUOTE=high;25829652]"their code"? They copied it out of a book.[/QUOTE] In this case maybe, but certainly not in every case.
[QUOTE=NovembrDobby;25829751]In this case maybe, but certainly not in every case.[/QUOTE] It's not just C++. Programming in general, I find, is quite an elitist subject. Edit: In a good way. Other programmers suggesting alternatives means less poorly written software.
I'm compiling the latest DarkGDK Source Code.
Sorry, you need to Log In to post a reply to this thread.