Solved

what kind of function is thiS?

Posted on 1997-04-06
2
187 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 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.net build a IF/Then Walkthrough Guide 1 279
thread-safe code in c++ 2 122
How to read a c++ line with strings and variable numbers of elements 6 44
C++ Code Issue 4 38
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

749 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