No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
18 Posted Topics
Re: what is string::npos for? help says it's a static const basic_sting , generic bad/missing length/position | |
Re: Here's the code XD [code] #include <iostream> using namespace std; int main() { int numbers[10]; int poscount=0, negcount=0, totalcount=0; cout << "This program accepts 10 integer numbers, the returns the sum of all positive\n"; cout << "numbers, the sum of all negative numbers and the sum of all the numbers." … | |
Re: My first unit using iostream XD [code] #include <iostream> #include <string> using namespace std; int main() { string softserve, topping, sprinkles; string order; do { cout << "Do you want chocolate, vanilla or twist?" << endl; getline(cin, softserve); } while( (softserve!="chocolate") && (softserve!="vanilla") && (softserve!="twist") ); do { cout << … | |
Re: I think I understand your first post now and the logic would go something like this. [CODE] I have a multidimensional array of 16 rows and 60 columns per row called 'weights'. I have an array of 16 rows called 'error'. I assume the first element in the 'error' array … | |
I need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color. So I figured the invaders are 3 child classes from a parent … | |
Re: Not sure of what you want to accomplish here. This piece of info might help getting the same results using a different method. | |
Re: First of all, sorry for thread hijacking ;) I too need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color. So I figured … | |
Re: You were also missing a bracket here and there You also didn't need addresses when passing the values of a, b, c and d You might not want the code but I did it anyway cos it's fun. [code] #include <iostream> #include <string> using namespace std; void menu(int a, int … | |
Re: Might be something like this [code] switch(sign) { case 11: { //lines here break; } case 22: { //lines here break; } . . . default: { } /*In the default's brackets, you should have what the control structure, switch(), will do if the variable, 'sign' in this case, doesn't … | |
Re: May you please PM me the entire assignment? I like these kind of game problems ^^. I would ask for you to post it but I don't think that's what you're here for. It may also help me understand the problem more in depth and help if I can. | |
Re: Using dynamic memory allocation, you can come up with this: [code] #include <iostream> #include <alloc.h> using namespace std; int main() { int nstores, *sales; cout << "SALES BAR CHART" << endl; cout << "---------------" << endl; cout << "Enter the number of stores: "; cin >> nstores; sales = (int … | |
Re: I've worked a little with files at school and from what I've gathered, to actually go to the end of the file you need to know how far that is from the beginning of the file either before hand or calculating it. This is not a problem with bit files … | |
Re: Might have to disable the UAP (User... something) and the other automated-application-running tool Vista's got. Go to User Management and disable that. then hit windows key + the pause key Then go to errr... I don't remember off hand, something about applications. If you can't find it or get it … | |
Re: I was able to come up with this [code] #include<iostream> using namespace std; int main() { double newn; char ans; do { cout << "This is a program that will help you find all the prime numbers between 3 and 100." << endl; cout << "Theses numbers are: " << … | |
Re: Use code tags please. That kind of post is a real bitch to format properly for a clearer view. =3 | |
Re: I would solve that as follows: [code] #include <stdio.h> #include <stdlib.h>] #include <conio.h> void main() { int **Registry; int nScholars; int i,j,sum=0; char *aux; do { printf("Enter the number of scholars: "); scanf("%d",&nScholars); }while( nScholars<0 || nScholars>100); Registry = (int**) malloc(sizeof(int*)*nScholars); if( Registry==NULL ) { printf("Error!"); getch(); return; } randomize(); … | |
Hello, I'm trying to simply copy the text from one .txt and create a new one and copying it to a new txt. I'm actually adding more text to that new file but that's not the part I'm having problems with. I could go through the entire .txt with this … | |
Re: No need to convert into strings. Try this [code] #include <iostream.h> #include<stdio.h> #include void parking() { int S_TIME,E_TIME,time_mins; cout<<"Please enter call start time\n\n"; cin>>S_TIME; cout<<"\n\n"; cout<<"Please enter call end time\n\n"; cin>>E_TIME; if( (E_TIME-S_TIME) > 0 ) time_mins = (( (E_TIME - S_TIME)/100) - 1 ) * 60 + ( 60 … |
The End.