46 Topics

Member Avatar for
Member Avatar for Alexkid

Hi there, ok, im fairly new to c++ and have been trying to figure this out for ages: I have a text file i want to read in that contains lines and lines of lat long points; N50 42.22 W002 55.33 N50 42.22 W002 55.33 N50 42.22 W002 55.33 i …

Member Avatar for Ancient Dragon
0
194
Member Avatar for globberbob

Hi there, im new to the site and am hoping someone out there can help me with my question, im pretty newbie in the world of c++ and programming in general. Im making a program with a menu, you can choose between entering a number yourself to be tested as …

Member Avatar for globberbob
0
311
Member Avatar for RobBobSmith

Hello all, I have a text file called: concentrations.dat The file contains a lot of different data. Here's the data that I'm interested in: # ET: list of elements <ET> 'Cu' 'C' 'Sr' 'He' 'Mg' 'O' 'Cr' What I want to do is read the elements into a vector called …

Member Avatar for RobBobSmith
0
248
Member Avatar for ayoitzrimz

Hello all, I am having an issue with ifstream. Short explanation: 1. I ask the user for the filename and read it via cin 2. I store the input in a c++ string 3. I use the input as the filename Here's where it fails: When a user enters something …

Member Avatar for VernonDozier
0
236
Member Avatar for rowanmck

Hi, I'm a newbie to C++ so please be patient. I have to create program that outputs a simple moire pattern or a graph of y-values from a .csv file depending on which one is called. The code below is what I have before main and is where I am …

Member Avatar for uridvir
0
2K
Member Avatar for rowanmck

I'm having problems with the code below, it compiles but no matter what I do it doesn't open the .csv file that I want it to. The file name is passed into this funtion then it must read the values in and then print them out, simple, yet I cant …

Member Avatar for Fbody
0
416
Member Avatar for Vani3863

Hi All, I'm a relative newbie having trouble completing a program that is required to read the text character by character from a .txt file and to then encode certain characters to something thing else. It is then supposed to be output to a separate .txt What seems to happen …

Member Avatar for Vani3863
0
157
Member Avatar for fire_

Hello. I have some problems. 1.With for cycle. This is my code: [CODE]#include <iostream> #include <fstream> int main () { int i; int i2; char sentence [200]; char repeat; ofstream file ("file.txt", ios::app); for (i=0; i<1;) { cout << "Enter sentence (max. 200 symbols)\n"; cin >> sentence; if (!file) { …

Member Avatar for Kanoisa
0
150
Member Avatar for Rickay

why doesn't this work? [CODE]int main() { fstream file; char output[100], pasword[100]; int a; const string x("Yes"); const string y("No"); string z; char b; cout << "\nEnter correct password to continue: \n" << endl; cin.getline(output, 15); if(output == "file.txt") { cout << "Change password? Type Yes or No. \n" << …

Member Avatar for Ancient Dragon
0
140
Member Avatar for Griff0527

I've searched the C++ forums and cannot find anything that relates to my question. I am writing a program (for class) that opens a txt file and reads doubles from the file, then computes the standard deviation of the numbers in the file. In order to do this, I am …

Member Avatar for Griff0527
0
244
Member Avatar for paddy8788

I just started working on a small tool to search for (heavy) text files using Visual C++ with MFC. Because there are a lot of readings, I'm wondering if ifstream of the standard library is better than CFile of MFC? I don't need portability (the program is for Windows Environment), …

Member Avatar for paddy8788
0
227
Member Avatar for 42Wired

I'm trying to open a file (ifstream object), read from the file, then pass the ifstream object to a function where it will continue reading from the file. Along the way, I want to store the path of the file, and would like to know if there is a way …

Member Avatar for 42Wired
0
294
Member Avatar for Clockowl
Member Avatar for whouton

Hi guys, I'm trying to make a function that allows the user to enter in a file name and access that file; if the file name is wrong or the file is not there, I want to allow the user to enter in another file name. For some reason the …

0
75
Member Avatar for jascase901

So far, I have only read about using void functions to take on ifstreams as a parameter. Yet I want to be able to make a single function that takes a file of numbers as a parameter, and do some calculation to each number. I can do this with a …

Member Avatar for alg
0
142
Member Avatar for smco9

I'm getting conversion errors 2446 and 2040 on the red line. Can anyone help me figure out what i've done. I'm new to C++ but I'm expereinced in C# so I do have some foundation. Any help is greatly appreciated! [CODE] string GetString(ifstream & fn, string & s, int length) …

Member Avatar for Ancient Dragon
0
221

The End.