2,025 Topics

Member Avatar for
Member Avatar for indigo.8

Hey guys I'm having a little problem with unsigned char and reading a file of integers into the array. 1. What the program is suppose to do: It's suppose to dynamically create an array of unsigned char that is the correct size to read in the array of numbers. The …

Member Avatar for indigo.8
0
2K
Member Avatar for hussey001

[CODE]#include <iostream> #include <fstream> using namespace std; void countWords(fstream &myText, int word); void countLines(fstream &myText, int lines); void wordLength(fstream &myText, int length); int main() { char textLine[100]; int lines = 0, word = 0; fstream myText; myText.open("myText.txt", ios::in | ios::out); if (!myText) { cout << "Cannot open file - myText.txt" …

Member Avatar for Fbody
0
108
Member Avatar for helpme87

So i am trying to make a program that takes the date from windows (this is not where i have the problem). My problem is i want to use that date and create a txt file for each day. For example it would create a file named... 8_4_2010 for today …

Member Avatar for helpme87
0
156
Member Avatar for shoebansari

I'm a 12th grader.. I made a user defined(about 12 functions) c++ program about the working of bank ATM's... Now i want to convert the user defined program to data file such as "ATM.DAT". is there any way out, and please remember that i use only [B]two [/B]file commands - …

Member Avatar for Rashakil Fol
0
63
Member Avatar for happygeek

Despite [URL="http://www.daniweb.com/news/story292997.html"]the ongoing signal strength problems displayed by the new iPhone 4[/URL], there can be no denying that the latest Apple gadget has been a runaway success. With Apple claiming 1.7 million units sold in just the first three days it would be hard to argue. One of the not …

Member Avatar for lapunluyang
1
450
Member Avatar for GuyClapperton

It's not in the stores yet but in Europe at least the anticipation is hotting up for the [URL="http://ww.nokia.com"]Nokia[/URL] N8 smartphone. It's causing excited ripples for two reasons: first it's going to be seen as the first time Nokia has come out with something serious to combat the iPhone in …

Member Avatar for GuyClapperton
0
272
Member Avatar for dchunt

I've wanted to write a program to read the extended characters from a file. [ICODE] #include <iostream> #include <fstream> using namespace std; int main() { char a,ch[50]; long l, m, k; ifstream infile; infile.open("as6.txt"); l = infile.tellg(); infile.seekg(0, ios::end); m = infile.tellg(); k = (m - l); infile.seekg(0, ios::beg); while(infile!=0) …

Member Avatar for kadams
0
136
Member Avatar for PCBrown

The same hacker behind the iPad jailbreaking software “Spirit”, and the iPad port of Flash, has released an easy to use jailbreak solution for the iPhone4. Comex and his cohorts have created a website that allows users to complete the job with a single swipe of the finger. [ATTACH=RIGHT]16317[/ATTACH]Users of …

Member Avatar for PCBrown
0
282
Member Avatar for vavazoom

I'm having an issue with the elimination portion of my Gaussian Elimination problem. The program crashes while running, I can't figure out what is causing the wrong rows to switch, and why it is not eliminating correctly. [CODE]void Matrix::gaussianElimination() { int i, j, max; for(j = 0; j < N; …

Member Avatar for mike_2000_17
0
216
Member Avatar for cgcgames

Hi everyone I am currently learning C++ and i am writing lots of small bits of code to get praticed in coding in C++. i am working on a user system atm which takes a signup from the user and puts it in a text file so the user and …

Member Avatar for cgcgames
1
91
Member Avatar for therobot

I've got a program that has three different classes, all of which have their own pointer to an class called ObsFileName, who's main functionality is to store the name of an output file individual to the class, and return it with a function value(). All throughout the program, when a …

Member Avatar for therobot
0
140
Member Avatar for lemonzipper

Hello All, I would like the user to be able to choose the file_name (assuming it already exists) and be able to append information to it. However, this condensed version, below, of what I'm trying to do gives me a compilation error. I feel like it has something to do …

Member Avatar for lemonzipper
0
258
Member Avatar for Tank1970

Hi all I am receiving these errors when compiling my code, I am new to C++ programming and have trouble with the actual writing of codes. Here are the errors I am getting. I am not looking for an answer but a step in the right direction to get the …

Member Avatar for jonsca
0
278
Member Avatar for Glass_Joe

With what seems like inescapable, up-to-the-minute coverage of dropped call banter swirling around a tech universe with Apple as the sun, you almost forget that other brands exist. The most recent angle on their reception debacle has been the “But they’re doing it too!” defense, Steve Jobs’ attempt at dragging …

0
368
Member Avatar for vavazoom

Hey...I'm working on a Gaussian elimination problem...my pivot doesn't seem to work correctly...the logic must be wrong. Also, does anyone know why "INFINITY" comes up as some of my random numbers chosen? Thanks in advance for any help! :) [code] Matrix::Matrix():N(0) { //Empty Matrix by default } Matrix::Matrix(int n) { …

Member Avatar for mike_2000_17
0
733
Member Avatar for VBNick

Hullo. I made a small webserver just to flex my winsock muscle, but it only works for small files like html files. Once I have processed the request to get the path of the file, I send the result like this: [code] ifstream fin; fin.open(URL, ios_base::binary | ios_base::in); if (!fin.good() …

Member Avatar for VBNick
0
177
Member Avatar for k2k

I just got a used Cisco 851 router from ebay and ready to play around with it. i connected it to my computer com port and start seeing something from the putty serial connection. i see something like this repeating and repeating.. what does that mean? Translating "stipp2.srv.hcvlny.cv.net"...domain server (255.255.255.255) …

Member Avatar for cguan_77
0
426
Member Avatar for Techwriter10

I'm on vacation this week and the airlines lost my luggage; I mean they lost them big time. It took more than a week of cajoling before I finally got my my suitcase from Aer Lingus. I'm staying in France and can't use my iPhone here without incurring huge charges, …

Member Avatar for malfoy
0
417
Member Avatar for joewinsock

Tool.h file [CODE] #ifndef TOOL_H #define TOOL_H #include <string> using std::string; const int LENGTH = 30; class Tool { Tool ( int = -1; string = " "; int = 0; double = 0.0 ); public: int getPartNumber(); int setPartNumber( void ); char getToolName(); int setToolName( void ); int getInStock(); …

Member Avatar for Andreas5
0
278
Member Avatar for coolblazer

Im having problem with saving register staff detail. After typing all the detail, and i choose to view the staff detail - it say "Data for Staff Number that have been entered is Empty." here's my full coding: admin.h [code]#pragma once #ifndef ADMIN_H #define ADMIN_H #include<iostream> #include<string> #include "Staff.h" using …

Member Avatar for coolblazer
0
174
Member Avatar for Jackie91

someone help me pls...The 'Add' works fine..but when i try to open it,my full name didn't show completely , such as 'Jack Sparrow' = 'Jack'.. help me pls. #include<fstream> #include<iostream> #include<string> using namespace std; void main() { string name; int age; int options =0; char filename[20]; while (options!=3) { cout …

Member Avatar for Jackie91
0
76
Member Avatar for steventaal

OK, so I have this program I am writing called 'GradeBook', and there is a problem that starting on int Menu1(), ' if (menuchc == "4") ', and ending [code=c++] if (menuchc == "y", "Y") { string tmp = "start " + po; system(tmp.c_str()); system("pause"); main(); } [/code] so, I've …

Member Avatar for jonsca
0
123
Member Avatar for Jackie91

[CODE] #include <cstdlib> #include <conio.h> #include <fstream> #include <sys\stat.h> #include <string> #include <iostream> #include <iomanip> using namespace std; struct Student_Record { string name; int id; string ic; string parentName; string address; int telNum, parentTelNum; bool deleted; }; Student_Record Student; #define STUDENT_NAME "Student.txt" Student_Record Employee; char choice; fstream *fs = NULL, …

Member Avatar for ShadowScripter
0
94
Member Avatar for cap2361

lost!!! I took a homework assignment that worked written in just main and for practice I wanted to make them classes with pointers and have one derived class of base. Although the while loop, for the most part worked before it was turned into a class, it now does not …

Member Avatar for sunrise_cool
0
200
Member Avatar for vlad44

hi everbody, i;ve made a file of size 128MB and fill it with nulls except for a part whose offset is (655424) i fill it with integer numbers from 1 to 129407 then i try to read an object of structure from it where that structure consists of four integer …

Member Avatar for vlad44
0
148
Member Avatar for vlad44

hi all, i was trying to write to a pre existent binary file but every time it would change the size of file and remove all of its contents so what i should i do????? here is an example to what i'am trying to say(it is not exactly the same …

Member Avatar for vlad44
0
113
Member Avatar for sisterjo

I am getting the following errors on my code below. Any help would be appreciated. 69 expected primary-expression before '>>' token 71 `next' undeclared (first use this function) 86`Total' undeclared (first use this function) 86 expected `;' before "Gross" #include <iostream> #include <iomanip> #include <string> #include <fstream> #include <cstdlib> using …

Member Avatar for mrnutty
0
187
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
258
Member Avatar for allonline

I have me problem in finding the error in the folowing program.the program writes all the information in an encrypted form would you help me in making it readable please? the program is: [code]#include <iostream> #include<fstream> using namespace std; struct customer { string fname; string Lname; int id; }; int …

Member Avatar for goody11
-4
109
Member Avatar for dhruv_arora

I wrote a program and created an object with fstream. Eg. [CODE] fstream f1; f1.open("s.dat",ios::out|ios::binary); f1.close(); [/CODE] Generally if there's no file such as s.dat, then it creates a file by the name but it it's creating one instead it exits the program. I have to then manually create a …

Member Avatar for p@rse
0
133
Member Avatar for newstar_water

Hello, I need to know how the get the integer value of a byte and vice versa. I want to get the integer value from a byte read from a binary file. I also want to convert the integer value back into a byte value for write. Below I have …

Member Avatar for dusktreader
1
4K
Member Avatar for newsguy

According to recent [URL="http://blog.quantcast.com/quantcast/2010/06/may-mobile-os-share-north-america.html"]reports[/URL] the Android operating system has an impressive 19.9% share of the US mobile web market. That's still some way behind Apple iOS on 58.8% but the iPhone has been around for a lot longer. It should come as no surprise, then, that Yahoo! wants to get …

0
604
Member Avatar for darkseid

[code]#include <iostream> #include <string.h> #include <fstream> #include "class.h" using namespace std; translator a[100]; int d,b,c; int n; int m; int x; int z; void translator::add() { ofstream iFile("singular.bin", ios::binary | ios::app); ofstream dFile("definition.bin", ios::binary | ios::app); ofstream pFile("plural.bin", ios::binary | ios::app); ofstream aFile("articol.bin", ios::binary | ios::app); ifstream gFile("nr.bin", ios::binary); gFile …

Member Avatar for nbaztec
0
111
Member Avatar for dhruv_arora

I created this function for my program : [CODE]int calcTotal() { petShop p; fstream f1; f1.open("Pet_Shop.dat",ios::app|ios::binary); int loc; loc=p.tellp(); float records; records=loc/sizeof(p); cout<<"Total number of records = "<<records; cout<<"Going back to main menu"; menu(); }[/CODE] I am getting this error : [CODE]error C2039: 'tellp' : is not a member of …

Member Avatar for dhruv_arora
0
100
Member Avatar for iamcreasy

I am trying to grab some data after opening a text file with append flag. I am using the following code...but nothing is being printed and program execution is progressing forward. Can anyone point me my mistake... [CODE] fstream outStream("test.txt", ios::app);string testID; cout << "Enter Teacher ID - "; cin …

Member Avatar for iamcreasy
0
341
Member Avatar for allonline

I have met a proplem in correcting the following file and please submit to me by correcting the errores and if you can please help me in sorting and updating this file #include <iostream> #include<fstream> #include<string.h> using namespace std; struct gum { string nam,fnam,typ_item,nam_pack,coun_cons; int tin_no,reg_no,tot_item,tot_pack; float weigh; }; void …

Member Avatar for Taywin
0
149
Member Avatar for teckforce

I have used Cisco products for years, from Ciscoworks, WLSE, ADSM, web interfaces on various hardware products, ACS, NAC appliance, mobility engine with IPS, CSM, and etc. but they seem to all have issues or otherwise prove to be more headache than what should be acceptable. What is wrong with …

-2
40
Member Avatar for iamcreasy

if i open a file ouput using [B]ofstream[/B] it's openmode is set to [B]ios::out[/B] and [B]ios::trunc[/B]... what I have to do, if I want to have only the ios::out flag...not the ios::trunc flag.Because, it is deleting all the previous contents. How do i undo this flag?or, what to do, if …

Member Avatar for iamcreasy
0
184
Member Avatar for iamcreasy

I am trying to change some data indside a txt file, based on the input given by the user.The input file is [B]indata.txt[/B](The commented part is, what it holds).And the output file is [B]"outdata.txt"[/B]... The problem is with line 52 and 53.Notice that in the loop from line 55 to …

Member Avatar for vijayan121
0
763
Member Avatar for dhruv_arora

It's my school project, I wrote this C++ program with file handling. I am getting these errors and I can't understand what's causing the errors, if anyone can rectify my program, that would be great. My program :- [CODE]#include<fstream.h> // for C++ and File-Handling functions #include<conio.h> // for getch() and …

Member Avatar for Ancient Dragon
0
349
Member Avatar for dchunt

I have a file over 100 Kb long. I want to perform operations on successive batches of 256 characters. [CODE] int fs=0; char ss[32556]; ifstream nm,nm1; nm1.open("as86.txt"); if(nm1.is_open()) { nm1.seekg(0, ios::end ); fs = nm1.tellg(); } nm1.close(); nm.open("as86.txt"); nm.read(ss,fs+1); nm.close(); cout << endl << fs << endl; ofstream mn; mn.open("as86.txt"); …

Member Avatar for nbaztec
0
106
Member Avatar for meepokman

Hi guys, I'm currently trying to produce a facial detection application, but I seem to have some problems. My program, is able to recognise multiple users, and match their captured image to one saved in the database. However, if a person who has not registered is photographed, it is supposed …

Member Avatar for meepokman
0
449
Member Avatar for dansnyderECE

I'm trying to use .open() but I'm having an issue with my arguments to this function. Here's my code: [CODE] vector<string> FDT_filename; ifstream is; is.open (FDT_filename[0], ios::binary );[/CODE] Which results in the following error: [CODE] ../sim_main.cpp:297: error: no matching function for call to ‘std::basic_ofstream<char, std::char_traits<char> >::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const …

Member Avatar for dansnyderECE
0
184
Member Avatar for petraarkanian

Working ASA 5505 (just took info off of it just a moment ago). Looks like new, Includes power cable and console cable. I can throw in ethernet cables if you really need them. Has 2 ASDM versions as well as 2 versions of the asa ios as shown below. If …

Member Avatar for masimk2003
0
328
Member Avatar for dansnyderECE

I'm trying to copy a string into a character array to be used in .write(). Here is a bit of my code to show you what I mean: [CODE] //input_buffer is a string that is determined during runtime int length = 5; char * buffer = new char [input_buffer.size()]; buffer …

Member Avatar for dansnyderECE
0
104
Member Avatar for kenji

Hey, Iv decided to tackle a bit off C++ before I start it in college in fall and Im sort of stuck on a problem. The book im reading is Accelerated C++ and its exercise 3.2. Basically the question asks to get values from the user and take for at …

Member Avatar for arkoenig
0
154
Member Avatar for Griff0527

Another new coder here, and yes, I am a student. I am NOT asking for a solution, but I am asking for guidance to point me in the right direction. I am supposed to write a code that receives input from the terminal as to the temperature in Fahrenheit and …

Member Avatar for Griff0527
0
2K
Member Avatar for bree9482

Hi guys hope ur are all well! I have a program im trying to finish and its not going well. I am quite new to C++ and am not the greatest. I have code that ill post, but the problem is when i run the program with the readfile(); function …

Member Avatar for VernonDozier
0
151
Member Avatar for ghost_from_sa

Hey guys I've got a similar post on here but the previous one i didn't actually get any help this has to be handed in today and I'm stuck. The situation is this: - Read a text file into an array (most likely a struct array // which i can …

Member Avatar for ghost_from_sa
-1
133
Member Avatar for LevyDee

I am reading in from a text file and storing the data into different string variables which are in my struct. Currently I use an asterisk to separate the info in the text file, and have a garbage string variable that I pass the asterisk into in my struct. I …

Member Avatar for LevyDee
0
123

The End.