Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 What does this error means:
1> c:\users\sherry\documents\visual studio 2008\projects\testing\testing\person.h(19): or 'std::istream &operator >>(std::istream &,Person &)' [found using... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 This is my Person.cpp file
#include "Person.h"
ostream& operator << (ostream& aOutput, const Person& aPerson){
aOutput << "Person's First Name: " ;
aOutput << aPerson.mFName << endl;... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 #include<cstdlib>
#include<string>
#include<time.h>
#include"Person.h"
#include<iostream>
using namespace std;
typedef Person* PersonPtr;
class BankAccount{
public: |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 one more ques...u know I have one function:
Person getAccountOwner() const;
It is related to class Perosn.h file..now as i did in my one argument constructor:
BankAccount::BankAccount(const... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 wow....it's working.....great thanks a lot |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 my mistake didn't remove // in front of declaration of GetAccountNumber(); |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 #include<cstdlib>
#include<string>
#include<time.h>
#include"Person.h"
#include<iostream>
using namespace std;
typedef Person* PersonPtr;
class BankAccount{
public: |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 #include<cstdlib>
#include<string>
#include<time.h>
#include"Person.h"
#include<iostream>
using namespace std;
typedef Person* PersonPtr;
class BankAccount{
public: |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 If I use that code for generating a unique # whithout having any getAccountNumber function then even i get these for these two lines in main:
int main() {
BankAccount ba ;
cout <<"running";... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 This is how I'm told to use this function:
To set the account number to a unique number you should use the functions:
srand(static_cast<unsigned int>(time(NULL))) and rand() functions
... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 If I try to use this in my main:
srand(static_cast<unsigned int>(time(NULL)));
mAccountNumber = rand();
cout << mAccountNumber
And remove that getAccountNumber function from... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 MITRMKAR do you agree with what i wrote in my last post regarding use of const.
i guess this should work?
If no then . i think I will need to include set function even and have the chances of... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 you know I'm not using any set function for creating a bank account, so once this value is returned in getBankAccountNumber, it won't be changed after that. this way every person would have a unique... |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 In my code the line 107 is
mAccountNumber = rand();
so it's complainig about this line |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 #include<cstdlib>
#include<string>
#include<time.h>
#include"Person.h"
#include<iostream>
using namespace std;
typedef Person* PersonPtr;
class BankAccount{
public: |
Forum: C++ May 11th, 2008 |
| Replies: 26 Views: 1,968 Here is my code for the program. which I'm trying to complie...I just started testing it and was going through it step by step...but the first function whichI started testing is getAccountNumbers,... |
Forum: C++ Apr 12th, 2008 |
| Replies: 16 Views: 1,347 |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 Is there any way in which i just use arrays & strings to make this function work.
main idea is to first compare the first and last name enetered by the user with that of the firstname and last name... |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 I'm trying to write with arrays and string, in the way you have written using vecotrs.
But I'm having difficulties with loops now.
void deleteFromBlackBook( ifstream& aInFile, ofstream& aOutFile)... |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 Thanks a lot. May be the algorithm u have used might help .Because I don't have to use vectors or cstrings to do this program.
I'm only using arrays and string here.
Let me try if i can make this... |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 yes i think u r right.
I shouldn't pass the arrays in my function.
is it that i should not pass even contacts[] in my function alongwith lName, fName?
because i tried just removing fName & lName... |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 but it still displays all the contacts even after i run this delete function? |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 yes i did change = to ==.
and wanted to make 12 to 17 look like this so haven't changed it.
this is not creating any problem or is it?
void delete(string contacts[], string fName, string lName,... |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 here's how it look like now. But it's not doing anything except just displaying the cout statements
void delete(string contacts[], string fName, string lName, ifstream& aInFile, ofstream&... |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 |
Forum: C++ Apr 6th, 2008 |
| Replies: 16 Views: 1,347 I'm having problem with this code.
Here's what I'm trying to do.
I want the user to enter the firstname, last name of the person whom he wants to delete from the phonebook.
then I try to compare... |
Forum: C++ Mar 31st, 2008 |
| Replies: 48 Views: 2,887 I'm trying this now :
void searchBlackBook(string contacts[], string foName, string loName, ifstream& aInFile) {
cout << "SEARCH FOR A CONTACT\n";
cout << "Type the contacts first name\n:";
cin... |
Forum: C++ Mar 31st, 2008 |
| Replies: 48 Views: 2,887 No there is no input file for the add function. the file ot1.txt is created in add function and all the added contacts are written on this file, later on this file is declared input file from where... |
Forum: C++ Mar 31st, 2008 |
| Replies: 48 Views: 2,887 #include<iostream>
#include<string>
#include<fstream>
using namespace std;
const char OUTPUT_FILE[] = "ot12.txt";
void introMsg();
void selectionMsg();
void addBlackBook( string contacts[],... |
Forum: C++ Mar 31st, 2008 |
| Replies: 48 Views: 2,887 I'm worried about the counter being gettin incremented because in add contact function I have stored lastName/tfirstName/tphone/n
at locations contacts[i]
where i gets incremented each time after... |
Forum: C++ Mar 31st, 2008 |
| Replies: 48 Views: 2,887 So i should do like this if (firstname == true && lastName == true) on line 27.
and will that proble of counter be solved if i add lines 38 to 43 |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 void searchBlackBook(string contacts[], string foName, string loName, ifstream& aInFile) {
cout << "SEARCH FOR A CONTACT\n";
cout << "Type the contacts first name\n:";
cin... |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 I tried but it's not giving me the names after searching... Please if u can help...shd i show the code how i have written?? |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 Ok, let me try this way. :) |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 that was my ques before that the user is going to type the firstName and lastName, which he wants to search in phonebook. In taht case I don't know what string firstName & string lastName is going to... |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 one more thing I was not able to use the string.find("substr")
what should I use to find the firstName from the string contacts[i]
and then to find lastName in the same string contacts[i] |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 Thanks. I'm going to try this. |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 yes I shouldn't use i parameter in function. I deleted it.
Regarding what my code for search is doing is: It should take foName, loName from the user which he wants to search from the phonebook.... |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 Thanks, I got it where the problem is, but i'm not able to figure out how can I solve that problem. I used this
x = contacts[i].find(foName);
to figure out where the substr foName is... |
Forum: C++ Mar 30th, 2008 |
| Replies: 48 Views: 2,887 I was compiling my code today and ir gets compiled but shows this error instead of giving the requierd results alongwith cout statements.
For the part which is creating problem the code is as... |