-
clrscr();
-
cout << " " << endl;
-
cout << " -- Current Record -- " << endl;
-
cout << " What is the Video Number?: ";
-
cin.ignore();
-
cin.getline(temp, '\n');
-
videoNum = atol(temp);
-
cout << " What is the Video Name?: ";
-
cin.ignore();
-
cin.getline(videoName, '\n');
-
But now im not sure how i get the second values, and replace them with the previous values found by the getline... -
cout << " " << endl;
-
cout << " -- New Record -- " << endl;
-
cout << " What is the Video Number?: ";
-
cin >> videoNum2;
-
-
-
cout << " What is the Video Name?: ";
-
cin >> videoName2;
-
-
-
Well i have this array .. - videoRec videoLib[SIZE]= { {123456, "Alexander",1, {"Joe Bloggs",23215}},
-
{24687, "Terminator 2", 1, {"Fred Nurks", 23456}},
-
{54321, "Titanic", 0,{"", 0}}};
For example.. if i enter 123456 and Alexander
-- Current Record --
What is the Video Number?: 123456
What is the Video Name?: Alexander
*Find in array ... where videoNum = 123456 & videoName = Alexander
-- New Record --
What is the Video Number?: 987654
What is the Video Name?: Ben Hur - videoRec videoLib[SIZE]= { {987654, "Ben Hur",1, {"Joe Bloggs",23215}},
-
{24687, "Terminator 2", 1, {"Fred Nurks", 23456}},
-
{54321, "Titanic", 0,{"", 0}}};
*Replace in array ...
0 2336 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Vikram |
last post by:
Hi,
I don't remember if it happened previously, but nowadays
I'm having problem with using cin.getline function and
cin>> function simultaneously.
I have Visual Studio 6. If I use cin.getline...
|
by: vknid |
last post by:
Hello, I have a question. Its probably a very newbish question so please be
nice hehe. =D
I have been reading through C++ Programming Fundamentals, and have come a
crossed an example program...
|
by: ma740988 |
last post by:
Consider:
ifstrem MyFile("extractMe.txt");
string Str;
getline(MyFile, Str);
getline above extracts the contents of MyFile and place into the
string object. Deduced using FROM/TO logic I...
|
by: Skywise |
last post by:
I keep getting the following error upon compiling:
c:\c++ files\programs\stellardebug\unitcode.h(677) : error C2664:
'class istream &__thiscall istream::getline(char *,int,char)' : cannot
convert...
|
by: KL |
last post by:
I am so lost. I am in a college course for C++, and first off let me
state I am not asking for anyone to do my assignment, just
clarification on what I seem to not be able to comprehend. I have a...
| |
by: Amadeus W. M. |
last post by:
I'm trying to read a whole file as a single string, using the getline()
function, as in the example below. I can't tell what I'm doing wrong.
Tried g++ 3.2, 3.4 and 4.0. Thanks!
#include...
|
by: jalkadir |
last post by:
I am trying to get character string from the user, to do that I use
getline(char_type*, streamsize), but I get a segmentation fault??!!
Can anyone give me a hand, what am I doing wrong?
--snip...
|
by: allspamgoeshere3 |
last post by:
Hi!
I'm having trouble reading text lines from a file describing the levels
for a simple game I'm creating.
Inside the function that reads the content of the file there is a loop
that basically...
|
by: Chen shuSheng |
last post by:
I have a code:
---------------------------
#include <iostream.h>
#include <stdlib.h>
int main()
{ int max=15;
char line;
getline(line,max);
system("PAUSE");
|
by: JackC |
last post by:
Hi,
How do i use stringstreams getline function to extract lines from an
existing string?
Say i have: string strlist = "line1\r\nLine2\r\nLine3\r\n";
I want to extract each line out into a...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |