No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
36 Posted Topics
Re: [QUOTE=grenadeh;659067]If you're going to be a jackass go ahead and refrain from using your keyboard, no one wants to read your insolence. He asked for help, not destructive criticism. Regardless, I have to agree that a fair amount of the time if you read the compiler message, you will generally … | |
Re: What confuses me is that you are doing a cout on a function that you need to interact with... you should split the two into two seperate functions within the class, one being a setBool, the other being a getBool | |
For instance... I have the class Deck, which represents a deck of cards, and I want another class, derived from that, called cards, I want class Deck to have a class array called Cards[52], so I can assign all the different values and strings to the individual Cards class instances … | |
Re: There is absolutely no point in using a pointer... | |
Which is in higher demand in the job market right now??? | |
Re: [QUOTE=TheBeast32;786960]I switched from Dev-C++ to Code::Blocks. No difference in compiler (I use MinGW), but I like the GUI a lot more than Dev's.[/QUOTE] This... | |
Re: I have a question, why, when your setting up a constructor, do you declare all the objects values in the cpp file, yet comment the exact stuff in the header, why not just do it all initial constructor | |
Just curious to see who has memorized the 70 or so lines to create a window, I for one am almost to the point of having it totally memorized, and I also know what it all means, thats obviously important :P | |
Re: Noone on here, I can nearly say I am 100 percent positive, will give an honest answer of anything besides C, you pie chart is done, very bad poll dude, no offense | |
Re: WTF, I went into your program and changed the 2 to a three and my computer started beeping about 3 times a second and printing off weird symbols on the console, i nearly messed myself | |
I want to create a battle system for an RPG game, one a little more robust then the previous one I made. This one I want to be very dynamic and easy to use. I want to use the Allegro API for it, but first I want to make sure … | |
So I'm having trouble with classes today, I want to do something like [CODE] #include <iostream.h> using namespace std; class Dummy{ char Name[256]; void setName(char nam){Name=nam;} }; int main(){ char[256] temp; cout << "Name?\n"; cin >> temp; setName(temp); } [/CODE] I want something like this to store a char array … | |
| |
Learn how to fully use the windows header with help from [URL="http://www.winprog.org/tutorial/simple_window.html"]Windows.h Tutorial[/URL], I'm pretty well along in the Programming world and was wondering if this would be really useful in becoming a programmer in the future. | |
Re: If I use things from another class I tend to just do a heirarchy, branching one off another and protecting the values i want only in the heirarchy, for example [ICODE] class Mother{ }; class Son: Mother //Mom class Births Son Class :P { };[/ICODE] | |
I must say I always love a program where I can use #include<vector> vectors are like the peanut butter to my chocolate! | |
[ICODE]//Deck Class #include<iostream> #include<stdlib.h> using namespace std; class Deck{ int Cards[51]; public: Deck(); void Display(); void Shuffle(); }; Deck::Deck(){ for(int n = 0; n < 52; n++){ Cards[n]=n; } } void Deck::Display(){ for(int n = 0; n < 52; n++){ cout << n+1 << ". " << Cards[rand()%51] <<endl; }} … | |
What I want to do is make a grading system. There is a vector for schools and classes and students, all of these which have their own class, derived from a class called system. [CODE]class System{ School * p; //School Pointer vector<School>sSort; public: //Splash Screen Function void Splash(); }; /*-School … | |
I've been reading up on templates and they just seem like so much hastle for so little reward. I can't find anyway to effectively use it over vectors. I am just having a lot of trouble learning them because the concept seems so weird. | |
After reading up on them in terms of class hierarchy, they seem to just be almost like comments, to remind you that all classes use this sort of function | |
Re: I suggest Allegro, its an excellent API, my favorite for 2d work allegro.cc | |
for(int n = 0; n<blocksx;n++){ for(int x = 0; x<blocksy;x++){ I just want to be able to shorten this into something easy so I could just type in like one word to get it to work, it is used a lot and sucks to retype... thx | |
I want to be able to bring the single instance class into a function of another class without having to take each seperate little variable from the class and inject it in, can I just do something like void Yeah(class *The Class) and then pass the class in easily??? Or … | |
Re: Your question is difficult to understand, but if you mean will it construct what you have in a default constructor to each instance of said class, then yes it should. | |
Topic... just wondering if it would be friend or pointers in the main or something else... | |
I want integers 1-52 to be drawn only once, so every "card" will be seen and not one picked twice, heres the code [code] #include<iostream> #include<time.h> #include<string> #include<stdlib.h> using namespace std; class Player{ int hand; }; int main() { srand(time(NULL)); int deck=53; int *drawn; int notdraw[52]; for (int n=1;n<53;n++) { … | |
All I need to know is how a good way to make sure integers between 1 and 52 wont be draw twice over in a for statement... I was thinking something like [code] srand (time(NULL)); int *drawn; //The card to be drawn int notdraw[52]; // All the cards that have … | |
Re: dude you should take the time to comment your code, its really quick and goes a long way in speeding up the debug process, what class is this for, intro to C++ or an advanced one or what??? What year of college you in too | |
Re: I hate VC++, its just such a pain to get going, I perfer Dev C++ for ease of use(though it has a lame debugger) | |
Re: shouldn't this be in the c# board, i bet they know both c++ and (obviously) c-sharp, we tend to only know the former... | |
Just wanted to know, I'm just doing a little dice rolling thing thats storing dice values according to how many times they come up every so often, just wondering if instead of making 50 lines of code doing if(sum==1) { ones+=1; } else if(sum==2) {... and so on, I'm thinking … | |
Re: hmm... your code has me thoroughly confused, i wont lie... why not try something like including putting #include<io.h> at the top... then when you get to copying the things, then throw in CopyFile("slav1.txt","slav2.txt",TRUE)... this should work, although I heard it wont work if you use linux... hope I helped somewhat … | |
I did Hello world about a month ago, (my first language was BASIC), and now im onto things like Templates and I got all of my classes pointers and filing stuff down fine...Im trying to get OpenGL and SDL going (I'm already doing pretty good with the Allegro library). Idk … | |
I wanna have my program be able to let the user manually open a text file by destination and retrieve data from it, I have everything like ifstream good, i just need to know how to let the user cin something like C:/files/myfile.txt, but with the ifstream format I need … | |
Re: just wanted to say (even though this is closed)... make the int small global (declare it [I]just before[/I] int main(). Globalizing variables ROX!!! | |
Re: The only book on C++ I have is the All in One Dummies Reference book, by Jeff Cogswell, I really can't recommend it, I'm brushing up on classes and enumerators and stuff, he has a tremendous amount of errors in not only the stuff in the book but in the … |
The End.