?
Solved

what kind of function is thiS?

Posted on 1997-04-06
2
Medium Priority
?
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
yonat earned 150 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.
Suggested Courses

801 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