Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
~2K People Reached
Favorite Forums
Favorite Tags
c++ x 27
c x 2

10 Posted Topics

Member Avatar for Lokolo

[code] FILE *infile; infile = fopen("coords1.txt", "r"); int num = 0; for(int num1 = 0; num1 < 5; num1++) { for(int num2 = 0; num2 < 4; num2++) { for(int num3 = 0; num3 < 3; num3++) { fscanf(infile, "%f", &num ); targetCoords[num1][num2][num3] = num; } } } [/code] I'm …

Member Avatar for Lokolo
0
265
Member Avatar for Lokolo

[code] void writingTransactionToFile(string transaction) { string temp; int test; ifstream myfile("transactionlog.txt"); ofstream tempfile ("tempfile.txt", ios::app); if (tempfile.is_open()) { tempfile << transaction; if(myfile.is_open()) { while(!myfile.eof()) { getline(myfile,temp); cout << temp; tempfile << temp << endl; } } else { cout << "Unable to open file."; } tempfile.close(); myfile.close(); } else cout …

Member Avatar for brechtjah
0
172
Member Avatar for MJFiggs

You aren't storing the items anywhere? All you are doing is increasing the number of items bought each time. And printing the latest item off. If you buy item 5, 6 and 1. You need to store this somewhere, maybe in another array? Then print out this array. Not the …

Member Avatar for MJFiggs
0
137
Member Avatar for Lokolo

Main.cpp This is where the problem lies. [code] #include <iostream> #include <time.h> #include <math.h> #include <iomanip> #include "LinkedList.h" #include <fstream> #include <string> using namespace std; void main(void) { LinkedList Customers; Customer* newCustomer; Entry* test; int i = 0; newCustomer = new Customer(1001, "Olly", "07/10/1988", "17 Bob Lane", "Hobbs Road", "UB3 …

Member Avatar for Lokolo
0
113
Member Avatar for nedsnurb
Member Avatar for nedsnurb
0
132
Member Avatar for Cwapface

[QUOTE=Cwapface;739772]ughhh...okay, class D is now able to access class A's function (yay!), but now it doesn't seem to be able to access the private members. Why? I thought when you used friend operator, it allows access to private members..?[/QUOTE] Not sure, change them to protected should work though.

Member Avatar for mrboolf
0
104
Member Avatar for elsa87

[QUOTE=elsa87;738841]i was trying..but the thing is that im weak at programming.. could u plz point me to my mistakes and help me remove the errors?[/QUOTE] He already has. You can't declare a function inside a function.

Member Avatar for WaltP
0
209
Member Avatar for Lokolo

[code] transactionInfo = date + " - " + _strtime( time ) + "New Customer - 1001 - Olly"; [/code] Ok so I've been trying to find it everywhere in C++ reference guides but it seems I can't do the above ^^ (says I cannot add 2 pointers). date is …

Member Avatar for Alex Edwards
0
190
Member Avatar for Lokolo

[code] int numOfMonths = numOfYears * 12; float monthlyRepayments; float actualRate = (rate/100)/12; //monthlyRepayments = (borrowAmount*(pow((1+actualRate),numOfMonths))*actualRate)/((pow((1+actualRate),numOfMonths))-1); monthlyRepayments = (100000 * (pow((1+actualRate),180) * actualRate))/((pow((1+actualRate),180))-1); [/code] Ok this is the actual equation: (100000*(1+A1)^180*A1)/((1+A1)^180-1) btw A1 =0.06/12 So the commented line is original one I tried, didn't work. So I tried just putting …

Member Avatar for Lokolo
0
153
Member Avatar for Lokolo

Btw below is the key parts of my code - not all as there are loads of lines: [CODE] //main.cpp #include <iostream> #include "Customer.h" using namespace std; void displayMainMenu(); int enterMainChoice(); void displayAccountMenu(); int enterAccountChoice(); int enterCustomerID(); Customer createCustomer(); void main(void) { unsigned short numberOfCustomers = 0; Customer *Customers[10]; *Customers[numberOfCustomers] …

Member Avatar for minas1
0
169

The End.