Member Avatar
C++: I'm using Microsoft Visual Studio 2012 and I am not sure what to do about these two errors: ... Prompt: Make program that reads 20 integers, display that array, and find min, max, sum, and avg. One method named "read from user file" which will ask the user to …
by DS9596 in Software Development ()
Member Avatar
C++: I'm using Microsoft Visual Studio 2012 and I am really confused and am getting errors. Prompt: Make program that reads 20 integers, display that array, and find min, max, sum, and avg. One method named "read from user file" which will ask the user to input a filename and …
by DS9596 in Software Development ()
Member Avatar
I am using fstream to open and close a file. The code works OK, except the the file does not close when I close it the first time. I need to invoke close twice. Any idea why? And, what this is saying about my code that I do not realize?? …
by tgreiner in Software Development ()
Member Avatar
I wonder why this program does not do any changes to the text file that I am trying to modify. Scenario: My program uses the Fstream header file, I declared infile as IFSTREAM and outfile as OFSTREAM. I simply want to transfer data from infile to outfile. The data is …
by markdean1989 in Software Development ()
Member Avatar
I wonder why this program does not do any changes to the text file that I am trying to modify. Scenario: My program uses the Fstream header file, I declared infile as IFSTREAM and outfile as OFSTREAM. I simply want to transfer data from infile to outfile. The data is …
by markdean1989 in Software Development ()
Member Avatar
I'm not understanding why i'm able to read from the file but i can't write to it. The fstream is open in both modes. Once the program finishes i haven't changed the content of the file. Thank you in advance. ...
by jBat -3 in Software Development ()
Member Avatar
Hello, I have a bug in my program somewhere and I cannot understand why. The program merely prints data from a binary file. Here is the code: Most of the time it works fine. However, sometimes it gives the wrong output. For example, when my test file contained (as read …
by Labdabeta 182 in Software Development ()
Member Avatar
Hello, Looking at the standard streams provided by the stl libraries, it seems as though it is impossible to have 1 stream to use for both standard console IO and file/string IO. However, before I give up I would like to ask, is this possible: From what it looks like, …
by Labdabeta 182 in Software Development ()
Member Avatar
hello again, so i want to make a programme where the file saved is saved with different names at every loop.. like at first loop it will save as file1.txt, 2nd loop file2.txt, so on... so this is my code... so this is what the code is, it will loop …
by Vikram Sehgal in Software Development ()
Member Avatar
Dear Kind DaniWebbers, I am trying to overload the fstream operators (ofstream/ifstream), so that I can save a class to a 'Binary' file and also display it with cout. But the ways in which each need to be implemented is different. Please can you show me how to define different …
by Elixir42 in Software Development ()
Member Avatar
I m reading data from a text file and then printing it. I am not sure what I am doing wrong but the program prints the last line that it reads twice.
by H_beginner in Software Development ()
Member Avatar
For my c++ class i have to write a code that will read integers in to a 2D array from a file and then, using functions/methods, determine if the array is a magic square. My problem is that when i build or compile i get "error C2664: 'DataIn' : cannot …
by Cj in Software Development ()
Member Avatar
I'm tring to make a programe which takes the string from user and save in file(data_file). But I also want to take the .txt file from window and read the file and save in my programe file(data_file). user just give the address of .txt file or any other method in …
by Ahsanali1603 in Software Development ()
Member Avatar
how I can modify the ofile object of fstream library, and the remaining data remain save as it was. e.g ofile: hello world name class this is the data ofile have and in modification i want to replace the name with "roll number". after modification ofile became ofile: hello world …
by Ahsanali1603 in Software Development ()
Member Avatar
Hi What is the difference between using the fstream library to read a file....and using something like a procedure below using the FILE* object? There seems to be two ways to read a file? Thanks
by furalise in Software Development ()
Member Avatar
Hello, I'm having a little trouble with a some code that I'm writing for homework. Basically, I'm taking two files that contain numbers and merging the contents into another file. The files do not have the same amount of numbers in them (one might contain 7 while the other contains …
by dirtydit27 in Software Development ()
Member Avatar
I have been getting used to c++ as I have been trying various scenarious on programs and exand on them with new concepts. This is my first try at exporting data from command line to a text file and the program runs fine with all the calculations. The real issue …
by gobiking in Software Development ()
Member Avatar
Hi, could anybody please tell me what i am doing wrong in this program. The goal is to read the student name and grade from a text file and print it on the screen. This is what i have so far. by the way this is for a school project …
by josey_matt in Software Development ()
Member Avatar
I am trying to add a comma to the end of each line ('\n') of a text file til the end of the file is reached. I am opening the file in append mode but am unsure as to how to go about identifying when the end of line is …
by Jorox03 in Software Development ()
Member Avatar
I need help running my program this is what it asks me for "Write a program that asks the user for the name of a text file. The program should display the first 10 lines of the file on the screen. If the file has fewer than 10 lines, the …
by stacey.rae.35 in Software Development ()
Member Avatar
When im using fstream.h its giving an error with using namespace std, how ever when i use simple fstream without .h , it is not giving error but not reading the file, How can i use fstream object using fstream.h header file along with using namespace std? Your urgent response …
by AmerJamil -4 in Software Development ()
Member Avatar
I'm writing a program that will keep track of every Anime/Manga I watch/read(I'm an avid fan). I'm trying to make a database in order to keep track of all of the titles of the Anime/Manga. My problem is that when i try to add a new title to the existing …
by Sci3nc3F1cti0n in Software Development ()
Member Avatar
I've been reading quite a few threads about creating new files if one doesn't exist...but I need it specifically for windows, in the current directory we are in. I've seen ` ` That's just checking to see if the file is there. Later on I will need to read the …
by TheComputerGuy in Software Development ()
Member Avatar
Hello! I'm new here, so correct me if this is the wrong location... but I'm trying to make a program for the Minecraft server I'm on, and it requires that if someone wants to make a map that is used on the server, that there's a .xml file that shows …
by 123386761 in Software Development ()
Member Avatar
Here I am not even sure how to approach. Do we read in the file name as an int array, and then eliminate duplicates and save the result in that same file? Any suggestions would be great! thanks.
by marnun in Software Development ()
Member Avatar
Hi - I'm trying to make a databse with the produkts from McDonald, but i can't figure out how. It is supposed to both read and write. Here's what i've made so far... Hope U understand:
by mathias.kastbjerg in Software Development ()
Member Avatar
Here is the exercise: My assumption it requires static variable that would remember how many times function was called. This is what I came up with, but on second call (according to codelab) it returns wrong value. Appreciate any advice.
by marnun in Software Development ()
Member Avatar
It seems I don't understand completely reading from and into files, line by line. Here is my code that is supposed to read lines of two file, into string variables, I assume, and then write them into third file: line of first file line of second file .... so on …
by marnun in Software Development ()
Member Avatar
Can some one briefly tell me about that how to do fileprocessing in c++
by ousaf -3 in Software Development ()
Member Avatar
hello everyone, I am having a major problem with this assignment that asks to create a function whose input is a reference to an input file, which asks user to enter a file name to open for input, then checks to see where the file opened successfully. the function returns …
by mochiboo5 in Software Development ()