2,025 Topics
![]() | |
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 … | |
[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" … | |
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 … | |
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 - … | |
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 … | |
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 … | |
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) … | |
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 … | |
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; … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) { … | |
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() … | |
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) … | |
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, … | |
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(); … | |
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 … | |
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 … | |
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 … | |
[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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
![]() | 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 … ![]() |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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"); … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
![]() | 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 … ![]() |
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 … | |
![]() | 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 … ![]() |
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 … |
The End.