run time error
|
Go4Expert Member
|
|
| 21Feb2009,23:50 | #1 |
|
keep getting a run time error failure to intialise, I know what it means but just cant solve it any ideas?
|
|
Go4Expert Member
|
|
| 22Feb2009,00:03 | #2 |
|
anybody?
|
|
Go4Expert Founder
|
![]() |
| 22Feb2009,11:30 | #3 |
|
Anything more you would like to share about the error ?
|
|
Go4Expert Member
|
|
| 22Feb2009,14:12 | #4 |
|
int main () // This is where the program starts it execution. It’s also the main function
{ char B [25]; // Defines variables char MBP[25]; // Defines variables char VCB [25]; // Defines variables int * HD; float * P; float * MBR; float * MBM; int * VCX; int * VCY; float * VCM; // Defines variables int X; int Y; int Z; // Defines variables int * A; //------------------------------------------------------------------------------------------------- cout << "Enter number of computer specifications required? "; // Displays A Task Title. cin >> X; // Stores Entered Values. cout << "You have chosen to set up " << X << " computer specification" << endl; A = new (nothrow) int[X]; if (A == 0) cout << "Error"; else { for (Y=0; Y<X; Y++) // Starts repeating statemen. //-------------------------------------------------------------------------------------------------- { cout << "Please Enter Brand? "; // Displays A Task Title. cin >> B[Y]; // Stores Entered Values. cout << "Please Enter Hardrive Size? "; // Displays A Task Title. cin >> HD[Y]; // Stores Entered Values. cout << "Please Enter Price? "; // Displays A Task Title. cin >> P[Y]; // Stores Entered Values. cout << "Please Enter Processor? "; // Displays A Task Title. cin >> MBP[Y]; // Stores Entered Values. cout << "Please Enter Motherboard RAM? "; // Displays A Task Title. cin >> MBR[Y]; // Stores Entered Values. cout << "Please Enter Motherboard Memory? "; // Displays A Task Title. cin >> MBM[Y]; // Stores Entered Values. cout << "Please Enter Graphics Card Brand? "; // Displays A Task Title. cin >> VCB[Y]; // Stores Entered Values. cout << "Please Enter X Display? "; // Displays A Task Title. cin >> VCX[Y]; // Stores Entered Values. cout << "Please Enter Y Display? "; // Displays A Task Title. cin >> VCY[Y]; // Stores Entered Values. cout << "Please Enter Video Card RAM? "; // Displays A Task Title. cin >> VCM[Y]; // Stores Entered Values. } //----------------------------------------------------------------------------------------------------- { COMPUTER* pc = new COMPUTER (B, HD, P, MBP, MBR, MBM, VCB, VCX, VCY, VCM); //COMPUTER PC(B, HD, P, MBP, MBR, MBM, VCB, VCX, VCY, VCM); PC.show_COMPUTER(); } cout << "What specification would you like to view "; // Displays A Task Title. cin >> Z; for (Y=&; Y<Z; Y++) cout << A[Y] << ", "; delete[] A; { system("pause>nul"); return(0); }}}; //------------------------------------------------------------------------------------------------------- The error keep ocuring in this part if the code , when it works it comes upto the point of asking the question about the HD and sais failutre to intialize hd runtime error |
|
Mentor
|
![]() |
| 22Feb2009,16:48 | #5 |
|
You haven't set HD to point to anything.
What compiler are you using? |
|
Go4Expert Member
|
|
| 22Feb2009,16:55 | #6 |
|
Visual express
how do you do that? |
|
Mentor
|
![]() |
| 22Feb2009,17:52 | #7 |
|
Same way you did it for A.
|


