Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
A)I want the follow program can be able to edit name or number and delete entries as contact details change.b) I want my program can select a Menu which includes search, Add, Edit, Delete or exit;
This is the program i made.(Can you help me to change my program to what i mention at the two points at the top?)
//Visual C++ 6
#include
using namespace std;#include
#include
int main()
{
char filename[12];
cout>filename;ofstream outFile;
outFile.open(filename,ios::app);
if(!outFile){
cerr> name >> homephone >> mobile ) {
outFile <cout <<"? ";
}outFile.close();
return 0;
}

You need to learn to walk before you can run.
Your program has numerous simple errors that indicate that you are pretty new to programming and don't have a good understanding yet.
- you declare the variable filename and attempt to use it in a cout before putting a value into it.
- cout > filename - I don't use cout and cin but I'm sure that the brackets used with cout must be <<. Again, filename is not initialized.
- you are using an uninitialized 'filename' to attempt to open a file
- cerr - shouldn't the brackets be <<
- outfile < cout << "?"; - at least the brackets are pointing the correct direction, but I don't think that this is a valid cout statement.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |