2,025 Topics

Member Avatar for
Member Avatar for Red20XX

Hi everyone, I am doing a C++ project for school in the UNIX lab that requires inheritance. My main program is calculating linear regression for some plotted points and I'm inheriting a linear system solver from another program. The linear system solver is suppose to print the solved values to …

Member Avatar for Red20XX
0
351
Member Avatar for Wolf CCMLG

I am having a difficult time with a BitStream class. I need to overload the extraction and insertion operator for the classes, but I am at a loss. Here is what I have so far. Any guidance is appreciated. [CODE] #ifndef BITSTREAM_H_ #define BITSTREAM_H_ #include <iostream> #include <fstream> #include <vector> …

0
76
Member Avatar for Ragster

Hi, this is my first time posting here so I'm sorry if I post something wrong. I have an assignment for my class and I think I have done everything right, well except for this one error that's been killing me. I get this error for each function call when …

Member Avatar for Ragster
0
710
Member Avatar for smeghead007

Hey guys I could really use some help here. In my program I need to ask the user for two 4 bit binary numbers . Then if they select add then add or if multiply then multiply. my problem is that I got the addition to work but the multiply …

Member Avatar for smeghead007
0
97
Member Avatar for vuhailuyen

I am working on a Dictionary project based on AVL tree. The Dictionary can add words from the input.txt. Here is the input example: 0 3 sheep,con cuu mother, me water, nuoc 0 : the code to show that you are about to add words to the Dictionary 3 : …

Member Avatar for vuhailuyen
0
127
Member Avatar for Jeddahforever

Hi guys i spend 3 weeks doing this project , but i don't know how to start implement the Delete and update , can u please help me guys .? here is my attachment and my code [CODE] #include <iostream> #include <fstream> #include <cstring> #include <cstdio> using namespace std; class …

Member Avatar for Ancient Dragon
0
126
Member Avatar for Mona..

Hi.. I want to compress a text file which is like this:(input.txt) [CODE] ffa11 ffb13 ffd2 e c e r [/CODE] and save the result in (output.txt) [CODE] #include<fstream> #include<iostream> using namespace std; int main() { char ch; int counter=0; fstream infile; fstream outfile; infile.open( "input.txt",ios::in ); outfile.open( "output.txt",ios::app ); …

Member Avatar for xikkub
0
1K
Member Avatar for Philosophy

I am working on an Encryption/Decryption program for class and have run into a problem. I seem to have gotten the encryption correct, but I am unable to decrypt what was encrypted in order to get an output equal to what originally went in. Here is the code I have …

Member Avatar for Philosophy
0
279
Member Avatar for rebellion346

So, when I run the program and try to list all the information I get an interesting error message that pops up: ----- Debug Assertion Failed! Program: ...ocuments\Programs\C + + Programs\Checkbook\Debug\Checkbook.exe File: f:\dd\vctools\crt_bld\self_x86\crt\src\tccpy_s.inl Line: 19 Expression: (((_Src))) != NULL ----- Though I have an idea that it probably has something …

Member Avatar for rebellion346
0
233
Member Avatar for fubuaddict

Im an IT student(just started) we had this basic assignment: Antivirus Suppose you are going to create an antivirus program. You will need to search a file for any trace of a virus and if found it should be removed. However, a backup of the original(“infected file”) file should be …

Member Avatar for Fbody
0
80
Member Avatar for doogidie

Im supposed to sort a file in decending order using bubble sort into an array. My code does all of that but it repeats the sorted array 50 times instead of just listing it once. This is a C ++ file on Dev. Thanks for your help, it's due midnight …

Member Avatar for alexchen
0
118
Member Avatar for Mushida

Sorry but I'm having a problem whit this function that is meant to let me edit records in a binary file. After I enter what I want to change an attribute to the file remains unchanged. [CODE]void updateStudent(fstream & file) { S students; long lenth; char snum[10]; char editChoice = …

Member Avatar for Mushida
0
202
Member Avatar for chubzyko

Guys, I really really need a hand on this simple problem that I think, for me, is a really really big problem. I'm using the compiler turbo C. I have all the codes working except that it does not go back to the main menu. Can you please check my …

Member Avatar for Clinton Portis
0
135
Member Avatar for jasleen12345

i have the following code...according to my book both the files should open...but it opens both the files...writes into them....but when i open them for reading....only one opens up....pls see where i am wrong....[CODE] #include<iostream> #include<fstream> using namespace std; int main() { ofstream fout; fout.open("country.txt"); fout<<"United States of America\n"; fout<<"United …

Member Avatar for jasleen12345
0
173
Member Avatar for soban

[code] #include <stdio.h> #include <conio.h> #include <iomanip.h> #include <ctype.h> #include <string.h> #include <iostream.h> #define input "d:\\tcpp\\bin\\files\\input.txt" #define tempo "d:\\tcpp\\bin\\files\\tempo.txt" void menu(void) { cout << "Menu\n\n"; cout << "A - Add\n"; cout << "D - Delete\n"; cout << "I - Display\n"; cout << "E - Edit\n"; cout << "S - Search\n"; …

Member Avatar for daviddoria
0
88
Member Avatar for n0de

Hi, been programming all day long, and tryed to compile my program, everything is fine, except some kind of nonsense with ofstream.. These are the problems, and i don't know why ofstream says such things, because in my other programs everything is fine with seekg, or tellg, and everything else …

Member Avatar for n0de
0
375
Member Avatar for Mona..

hi.. i write this statement there is no errors but it not showing me the out put this is the my code: [CODE] #include<fstream> #include<iostream> using namespace std; int main() { fstream infile; fstream outfile; infile.open( "classnames.txt",ios::in ); outfile.open( "bufferednames.txt",ios::out ); infile.unsetf( ios::skipws ); int ch; for( int i=0; i<4; …

Member Avatar for Mona..
0
258
Member Avatar for TonyMUK

This is driving me mad. This program reads 8 records from an iseries data queue and then I get the segmentation fault. I can't work out why. Does anyone have any ideas? Please!! [CODE] #define WIN32_LEAN_AND_MEAN // Include the necessary DQ Classes #include <iostream> #include <fstream> #include <windows.h> #include <cwbdq.h> …

Member Avatar for TonyMUK
0
137
Member Avatar for User4699

I'm trying to implement a maze program by using nodes that reads in a file and the user is able to enter a direction and solve the maze. My class will not output correctly and I've been working on it for a LONG time. Any help is appreciated! I also …

Member Avatar for Greywolf333
0
679
Member Avatar for rebellion346

This is a program my instructor wrote and I have to create a program that similar in format. My issue is I don't quite understand what main is doing or how it works, was hoping someone could explain it to me in detail. Rolodex.h [CODE] #ifndef _ROLODEX_H_ #define _ROLODEX_H_ #include …

Member Avatar for Shantari
0
531
Member Avatar for Nandomo

I am in need of an explanation on how to pass information from my input file to my program. This is what I'm trying: [CODE]#include <cstdlib> #include <iostream> #include <fstream> #include <string> using namespace std; struct BevInfo { char bevName[11]; float bevPrice; int bevLeft; }; int main(int argc, char *argv[]) …

Member Avatar for Clinton Portis
0
111
Member Avatar for dnambembe

can anybody tell what's wrong with this code! //=========================================================================== // hybrid.cpp --this file implement the hybridlist class // Time-stamp: <2010-10-29 18:52:46 Dnambembe> // To compile: // g++ hybrid.cpp // Copyright (c) 2010 by Domingos Nambembe. All rights reserved. //=========================================================================== #include<iostream> #include<cstddef> //need NULL #include"hybrid.h" using namespace std; typedef NodeType* NodePtr; …

Member Avatar for dnambembe
0
128
Member Avatar for dhawalruud

[code] #include<iostream.h> #include<conio.h> #include<iomanip.h> #include<stdio.h> #include<stdlib.h> #include<fstream.h> #include<string.h> int n=0; // current no. of players ( to add to next one) int num=0; // total number of players class date { public: int dd; int mm; int yy; }; class players { public: char name[30]; date dob; char userid[30]; char …

Member Avatar for jonsca
0
691
Member Avatar for precila

The C++ I/O system supplies an interface to the programmer that is independent of the actual device being accessed. This interface is known as stream. The I/O system contains a hierarchy of the stream classes used to define various streams to deal with the console and disk files. These classes …

Member Avatar for precila
0
204
Member Avatar for steve_Student

Hi I am creating an program for my degree, it’s a program that logs call times, days, gives total cost and discounts depending on days of the week, at the end of the program it out puts all results then give an option to start over again or exit. So …

Member Avatar for steve_Student
0
169
Member Avatar for HBK_100

[CODE] void RB_number() { int roomnumber; string category; string type; string status; float rate; int roomid; //Try,catch and throw statement for exception handling to catch errors that are inputed from the user try { cout<<"\n\n\t\t\tEnter the Room ID you wish to view:"; cin>>roomid; if(roomid < 0) throw "Error"; } catch(string) …

Member Avatar for daviddoria
0
111
Member Avatar for steve_Student

Hi i am a total beginner and studying for a FD degree in C++. My assignment states Assignment Details a telephone company requires a program to calculate call charges for their customers. The regular charge rate for long distance phone calls is £1.50 for the first 3 minutes (or part …

Member Avatar for steve_Student
0
189
Member Avatar for smeghead007

ok guys need some help, I'm sure the answer is simple but i'm making a program for an assignement that models points in a cartesian plane and prints them out this is what i have so far in main [CODE]#include "point.h" #include <iostream> #include <string> #include <fstream> //for ifstream,ofstream #include …

Member Avatar for smeghead007
0
106
Member Avatar for araib

hey guys...!! i really want ur help in this program..!! its a Hospital management system program..!! it take input from the use..it can save input in a file..display all input on to screen, but i cant find a way to delete a record/patient details from the file PLZ help me..!! …

Member Avatar for araib
0
365
Member Avatar for geojia

Hi, this is my first time posting and I would like thank everyone in advance. I'm doing a homework assignment that requires me to design a teller application which simulates a bank. I'm currently getting a segment fault, after I call one of my getBranch(). I've tried to do this …

Member Avatar for geojia
0
181
Member Avatar for borogirl09

I am working on a program that reads students name and test score from a file. The program should assign the appropriate letter grade, then output the name score, and grade. It should also determine the highest test score. I do not see where my errors are. Please help! [CODE]// …

Member Avatar for VernonDozier
0
155
Member Avatar for aikiart

Hello, I've got a simple program where i'm trying to a Char array with a string, but even though the program in debug mode shows that the string Phone = Phone, it is not adding a new line when the string starts with Phone. Can anyone tell me why the …

Member Avatar for Ancient Dragon
0
161
Member Avatar for ironmancpp

Hi everyone! I am a class XII student. I have been asked to make a project using c++. I have decided to make a word game. The game's objective is: * show a random jumbled word stored in a file * ask the user to enter any valid words that …

Member Avatar for mtbs1826
0
240
Member Avatar for pooja_singh

hi!! i,ve written d program on airline reservation .... but i m facing problems regarding the value of seats ... that is how do i sore different values of seats available in diff flights [code] class air { protected: int z; char clas[10]; char source[5][10]; char dest[5][10]; int seats; int …

Member Avatar for sai shiva j
0
1K
Member Avatar for Tiny_trixer

I was wondering. Is there a way to write something from one method in to a result file instead of outputting to screen? To describe a little better, in pseudocode: [CODE] #include <iostream> #include <fstream> using namespace std; class Inputoutput { private: ifstream fileOne; ofstream fileTwo; int i; //More variables …

Member Avatar for drkybelk
0
139
Member Avatar for malayasthana

in the program i am creating a file with specific path.. file name is to be entered by user and then we have to create a file but the code is giving the error written after the code. void f_Createfile() { string dirpath; // stores final name for file with …

Member Avatar for jonsca
0
132
Member Avatar for dnambembe

Hi, I am writing a code that reads input from user to create a linked list database at the same, time it write the data received in to binary file. when I run the program is supposed to prompt the user to enter the data for ten time, however the …

Member Avatar for dnambembe
0
1K
Member Avatar for biju127

Whats wrong with this code. I can create the DAT file.Name and Grade is writing to the file perfectly. but the file contains ASCII values for RollNO and after Grade. [B]Output file:[/B] Name A ÈB [B]Program[/B]: #include<iostream.h> #include<conio.h> #include<fstream.h> #include<string.h> class stu { int rollno; char name[20]; char grade; float …

Member Avatar for biju127
0
217
Member Avatar for Gumbo

Hi I'm doing an assignment on Rational Number calculations. I'm getting some compiling errors which I don't know how to fix. Here is the error message and the code is beneath the error message. I would really appreciate if someone could read over this and see if you know whats …

Member Avatar for Gumbo
0
186
Member Avatar for stvnddich

I need to write a program that generates a magic square of an odd number between 3 and 15. I have written out this much code, and when i type in 3 for the number it gives me the correct square. but any other odd number it gives me an …

Member Avatar for stvnddich
0
144
Member Avatar for chuck577

I am finally learning about fstream but Im stomped with this problem that I have. I have a current file that I am opening. Each line of said file looks like this: D40001~10997~811~DANIWEB~555-555-5555~7.70~I~2111 There are around 5000 lines with different DXXXXX numbers. I want the user to input a dnumber …

Member Avatar for frenzy50187
0
1K
Member Avatar for baldwindc

ifstream mystream(file_name); ofstream outputstream(filename, ios::out); do { mystream.getline(line, 100); mystream >> country_name >> happiness_value; total_happiness = total_happiness + happiness_value; count++; outputstream << country_name << " \t \t " << happiness_value << endl; } while (!mystream.eof()); the file ifstream is reading from is a .dat file, in this format: first 1 …

Member Avatar for baldwindc
0
1K
Member Avatar for malayasthana

[CODE]vector<string> file_pass; if(count == m2+1) { p2_pass = onfile.tellg(); shift = p2_pass-p1_pass; onfile.seekg(-shift,ios::cur); for(j=0;j<shift-1;j++) { onfile.get(ch); temp_pass[j] = ch; } user_pass.assign(temp_pass,temp_pass+shift-1); file_pass.push_back(temp_pass); }[/CODE] for first input asthana it is giving asthana but after push back for second input saxena it is giving saxenaa i know last a is from first …

Member Avatar for Fbody
0
151
Member Avatar for FALL3N

I jailbroke my iPhone with iOS 4 a program called 'limerain'. With it, I installed Cydia, and a few other applications that Cydia allows. A few days after I jailbroke the iPhone, it stopped getting service, which is really weird, because it's not like it was right after... I still …

Member Avatar for peter_budo
-1
82
Member Avatar for claudiordgz

I guys, i have a problem with binary files A file is opened in the beginning of the main then a case to give the user a choice: 1.- Show the content of the file 2.- Search for a name 3.- Search for a type of crime 4.- Search for …

Member Avatar for claudiordgz
0
106
Member Avatar for atar

Hello there!!! I wanted to announce here that the new iOS 4.1 version that apple released some weeks ago, cause to very many WiFi problems. users report [URL="http://discussions.apple.com/forum.jspa?forumID=1390"]at this forum[/URL] that indeed the iPod indicate that it is connected to the internet but when the user try to access the …

Member Avatar for logoonlinepros
0
163
Member Avatar for whodoes21

Hello members of Daniweb :) I am a frosh IT student and I need little help with this :) ok so the program is basically a simple cashier program. you enter a code for an item. you buy it compute for the change etc. etc. now my problem is with …

Member Avatar for whodoes21
0
208
Member Avatar for lotrsimp12345

Having problems with executing jobs using fork. The code is supposed to create one job and execute one job and repeat this multiple times. We are only supposed to use usleep in the jobgeneration() function. We are having trouble sleeping and executing ctrl-c in the execute job function. [CODE] #include …

Member Avatar for lotrsimp12345
0
510
Member Avatar for M a H a

hi everyone = ) i wrote program using C++ it's for type a small letter then it will print it back in a capital letter using file processing i wrote the letters in txt file in the same c++ folder like this way a A b B c B and …

Member Avatar for Fbody
0
404
Member Avatar for Shijo Jose

I am trying to create a program to log the medal tally of the cwg. However,I'm still getting wind of using binary files. It seems as if nothing is being read from or written into them. Below is my entire code. It would be of help if somone could direct …

Member Avatar for Taywin
0
201

The End.