Solved

what kind of function is thiS?

Posted on 1997-04-06
2
185 Views
Last Modified: 2010-04-10
hi there,
        I am doing a project on creating a simple database (storing particulars of friends) using C++. The user is suppose to key in the required data and the program is to search for the data in the external file and display it on the screen for the user and therefore the user can edit or just view the data he/she wants. Searching for the data in the external file is something which i cannot do since the examples given by our prof is not sufficient and so are the books I borrow from the library school.

And so what kind of function in C++ can it search for the required data (the file is suppose fill with alot of data ) and display it on the screen.
It will be a great help if it is in source code
0
Comment
Question by:ftyk
2 Comments
 
LVL 5

Accepted Solution

by:
yonat earned 50 total points
ID: 1162603
You can read using an fistream. For example:

#include <fstream.h>

char line[MAX_LINE_LEN];
fstream f("bla.txt");
f >> line;
// do stuff with it.
f.close();

The way to display text on screnn depends on the operating
system.
If you just want text I/O, you can use cout:

#include <iostream.h>

cout << "some text";

0
 

Author Comment

by:ftyk
ID: 1162604
Edited text of question
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
why "." vs "->" 23 120
how not to pass environment to child process by using ShellExecute or ShellExecuteEx 16 115
C++ question 3 65
draw a Christmas tree by using a nested loop? 26 62
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question