No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Re:
I am trying to make an ATM machine, while trying to teach myself how classes interact with each other. I feel as though the main idea of the program is correct, but as you can see, I am having a lot of syntax errors. If you guys see something that … |
|
Re:
hi, i have the following code: [code]#include <iostream> using namespace std; class test{ public:: bool t() { cout<<"enter your answer(y or n)\n"; int answer = 0; cin>>answer; if (answer =='y') return true; else return false; } }; int main(void){ test t; return t.t; } [/code] i get this error: cannot … |
|
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:
hi guys..! i need some help on how can i print out the output of my program.. the problem is, it will only print out the first char of a characters and i don't know how to use the pointer using an multidimensional array. ex. input: jhonny output: j here's … |
|
|
|
Re:
what does everyone else use? Another question i have is if there are any significant advantages of VC over Dev? I was figuring out if i should make the switch or not. |
|
Re:
Hello I was making a program called englishweight and it has three main components englishweight.h which is a class declaration, englishweight_def.cpp which defines the public member fucntions, and EW_driver which uses the class to calculate what to do with the englishweight and preforms very basic operations. My program works WITHOUT … |
|
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:
Hi. I was just wondering what you thought about C++ and windows development. I'll post a pie chart daily as long as people continue to respond. The Question: What do you think about C++ and windows development.? A - You should only learn C++ B- You should only learn Windows … |
|
Re:
I'm trying to learn C++, and I thought I'd start by exploring classes, so I wrote this: [code=c++] #include<iostream> #include<string> using namespace std; class user { public: string logonName; string firstName; string lastName; int uID; }; int main(){ user users[2]; int i; users[0].logonName = "rawrMander"; users[0].firstName = "Rawr"; users[0].lastName = … |
|
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:
Can i call a class on another class. ex. class a { public: void add (int,int) ... //maybe call class b here.../// }; class b{ public : void mult(int,int)... }; |
|
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:
hey... im in a c++ class at school but i also program at home. my teacher refuses to teach me graphics and i wanted to know if there was an easy way to just basically cout a graphic. if this is noobish and i need to learn a lot more … |
|
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:
If you make a vector of a class of no designated size, as you reserve spaces inside the vector will it just make a default instance from the constructor? |
|
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:
Please help me doing my homework. this homework done with C++ Data Structure. This is Questions: [URL="http://img520.imageshack.us/img520/4417/qqqq1gvq5.gif"]http://img520.imageshack.us/img520/4417/qqqq1gvq5.gif[/URL] [code]#include <iostream> #include <stdio> #include <assert> #include <string> #include "bt.h" class Calc { public: } ; int main() { bSearchTreeType<Calc> obj; string command; cout<<"I-Inputtheexpression"<<endl; cout<<"N-InorderTraversal"<<endl; cout<<"P-PreorderTraversal"<<endl; cout<<"O-PostorderTraversal"<<endl; cout<<"F-Numberofoperatorinthetree"<<endl; cout<<"E-Evaluatethetree"<<endl; cout<<"Q-Quit"<<endl; cin>>command; do { … |
|
Re:
Hi I'm was a c++ programmer for 7 years past with VC++ then go to Java and now return to c++ , I've search for VC++ and its seems big change now (VC++ Express Edition ) . I looking for free VC++6.0 or any other easy/free editor for c++ programming … |
|
Re:
can someone convert this c++ code to C# code... I'm very new to C# pls help the main.cpp [code=cplusplus]// Main Program // #include "square.h" // Derived Class square int main() { //******************************************************************************* cout << "\t\t\t+y"; cout << "\n\t\t\t +"; cout << "\n\t\t\t +" << "\tpoint a" << "\t\t\t\tpoint b"; cout … |