Forum: C Jan 10th, 2009 |
| Replies: 1 Views: 343 I am retarded.
1. int for putting into the array (duh?)
2. it had nothing to do with the files once I fixed the ^^, my taking the numbers out of the array was wrong.
I hate last minute work. |
Forum: C Jan 10th, 2009 |
| Replies: 1 Views: 343 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++)
{... |
Forum: C++ Nov 19th, 2008 |
| Replies: 6 Views: 412 #include <iostream>
#include <iomanip>
using namespace std;
const int NumItems = 7;
int numOfUserItems = 0;
char userItems[10]; //max of 10 items per user
const int StringSize = 8;
int... |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 Funnily enough, that makes perfect sense!!!!!
THANKS LOADS!!!! :) |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 Ok understand about methods and functions. Was the 'member' bit I didn't understand.
Ok so basically, if I get you straight.
Any classes with are pure inheritence, anything which is sibbling... |
Forum: C++ Nov 19th, 2008 |
| Replies: 7 Views: 401 Not sure, change them to protected should work though. |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 Luckily I remember about the stupid squiggle (~~~~ EEK!!!!!!!)
Not sure I understand what member function is? I have Account class with a constructor (if that what you mean?) and also so... |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 lol thanks. So does making it = 0 make it pure virtual?
That gets past that error but creats more errors in the rest of my program. I have more than 1 type of Object, one is Accounts which is... |
Forum: C++ Nov 19th, 2008 |
| Replies: 9 Views: 473 1. Next time try to tell us which line it is.
2. If( ) has brackets.
i.e.
if input == 1
return recursiveGCD;
if input == 2
return iterativeGCD; |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 Ok I get that but I have returnCustomerID in Customer class. Is that not enough? I thought it would pick it up
i.e. I declare it in Object, write the body in Customer, and it would link the 2... |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 Virtual doesn't do anything. (gives the same error but with virtual infront of the function error)
Because Customers are a type of Object.
And not sure about define, don't understand? |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 lol yes I am not that silly. My codes a lot bigger than that, I just didn't want to waste too much space.
int i = 0; <---- inside void main(void) |
Forum: C++ Nov 19th, 2008 |
| Replies: 9 Views: 473 Why don't you just declare it in main? (like you have with x and y) |
Forum: C++ Nov 19th, 2008 |
| Replies: 14 Views: 652 Main.cpp
This is where the problem lies.
#include <iostream>
#include <time.h>
#include <math.h>
#include <iomanip>
#include "LinkedList.h" |
Forum: C++ Nov 19th, 2008 |
| Replies: 10 Views: 807 Ok realising I am retarded. I should have taken the 'Error Message' literally. It kept saying 'File Exists', which I then thought yes, it does exist, so rename it to that! Raging at my laptop.
... |
Forum: C++ Nov 19th, 2008 |
| Replies: 10 Views: 807 1. No I thought it would overwrite it (like if you try to open a file, if it doesn't exist, it creates one)... guess it doesn't. Will look up file delete later (I funnily enough have a C++ tutorial... |
Forum: C++ Nov 19th, 2008 |
| Replies: 10 Views: 807 At the top of the text file.
i.e. its a list of transactions and I want the most recent transactions at the top. At the bottom of the file is the first transaction.
My text file would look... |
Forum: C++ Nov 18th, 2008 |
| Replies: 10 Views: 807 Because I want the latest data to be at the top and this is the only way to do it. |
Forum: C++ Nov 18th, 2008 |
| Replies: 10 Views: 807 void writingTransactionToFile(string transaction)
{
string temp;
int test;
ifstream myfile("transactionlog.txt");
ofstream tempfile ("tempfile.txt", ios::app);
if (tempfile.is_open())
{... |
Forum: C++ Nov 18th, 2008 |
| Replies: 6 Views: 412 #include <iostream>
#include <iomanip>
using namespace std;
const int NumItems = 7;
int numOfUserItems = 0;
char userItems[10]; //max of 10 items per user
const int StringSize = 8;
int... |
Forum: C++ Nov 18th, 2008 |
| Replies: 7 Views: 487 He already has. You can't declare a function inside a function. |
Forum: C++ Nov 18th, 2008 |
| Replies: 6 Views: 569 Thanks.
You say so simple... Simple would mean it should allow me to do as I have done. As its what I have done, but in multiple lines.
Pretty lame you can't do it on one line. :) |
Forum: C++ Nov 18th, 2008 |
| Replies: 6 Views: 569 Did the bottom 2 things:
#include <string>
string transactionInfo;
char currentDate[10]; // cin >> current Date = 01/10/2008
char currentTime[9];
transactionInfo = currentDate + " - " +... |
Forum: C++ Nov 18th, 2008 |
| Replies: 6 Views: 412 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... |
Forum: C++ Nov 18th, 2008 |
| Replies: 6 Views: 569 transactionInfo = date + " - " + _strtime( time ) + "New Customer - 1001 - Olly";
Ok so I've been trying to find it everywhere in C++ reference guides but it seems I can't do the above ^^ (says... |
Forum: C++ Nov 16th, 2008 |
| Replies: 1 Views: 376 I've solved it.
actualRate = (rate/100)/12
Rate was set to an int, so actualRate was just set to 0 as the equation made it equal to 0.005, which obviously in int terms is0.
However theres no... |
Forum: C++ Nov 16th, 2008 |
| Replies: 1 Views: 376 int numOfMonths = numOfYears * 12;
float monthlyRepayments;
float actualRate = (rate/100)/12;
//monthlyRepayments =... |
Forum: C++ Nov 7th, 2008 |
| Replies: 5 Views: 423 #include <string>
#pragma once
using namespace std;
//----------------------
class Customer
{
private:
string name; |
Forum: C++ Nov 7th, 2008 |
| Replies: 5 Views: 423 Btw below is the key parts of my code - not all as there are loads of lines:
//main.cpp
#include <iostream>
#include "Customer.h"
using namespace std;
void displayMainMenu(); |