2,025 Topics

Member Avatar for
Member Avatar for slacke

I have lots of Drytek > Vigor 2700,2800 routers on the public net. I manage this networks and since this type of routers has Log support I write an application on my linux box to collect those logs. The routers are sending UDP datagrams to a configurable address and port. …

Member Avatar for slacke
0
211
Member Avatar for yara naser

hi im write this code with no error but in run it doesnt give me the best result i dont know why please if you can help me soon because i must recive this home work suuday not the block file have any statement in c++ and tokens-result are empty …

Member Avatar for Salem
0
215
Member Avatar for Smoking Bros

Hello guys! I'm new at C++ (started yesterday) but I'm a fast learner and I think I got pretty far with this noob project! The only thing I need to do is to make C++ open my .txt file and the beta version of this application is done! By the …

Member Avatar for AssaultM16
0
225
Member Avatar for declain

I am working on an example for a class and the build succeeds, but when it runs, it just hangs and won't complete. Not sure what I'm doing wrong? [code] #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { istream *fin = &cin; if(argc > 1) …

Member Avatar for declain
0
161
Member Avatar for teddyg18

when you run an ifstream in c++ and go into a textfile what is the data in the file converted to? this is my code [code] #include <iostream.h> #include <fstream.h> #include "TGraph.h" #include <time.h> #include "TDatime.h" void deeznutz() { char inputFilename[] = "data.txt"; ifstream inFile; int x; inFile.open("data.txt", ios::in); if …

Member Avatar for teddyg18
0
160
Member Avatar for Mnkyman1030

Hi, I'm having trouble with a program that I have to write that is supposed to convert a prefix expression to a postfix expression using stacks. The program I wrote seems to compile fine but when I run it, it gives me a fatal error and aborts the program. I'm …

Member Avatar for Mnkyman1030
0
1K
Member Avatar for Slephnir

I am learning c++, below is an attempt at a simple XOR encryption program. I am am using Dev c++ (Blooodshed Ide) using the ming-gw win 32 gcc compiler blah blah. This code compiles without errors or warnings but it will not produce an 'exe' only a '.o' file, firstly …

Member Avatar for Salem
0
2K
Member Avatar for xiikryssiix

if anyone can check out my program below and see whats wrong, itd be greatly appreciated. my goal: user input a text file (i.e. data.txt) to open and read print the mssg within file to both console and text file (i.e. secret.txt) print the mssg as scrambled message (ASCII) my …

Member Avatar for xiikryssiix
0
118
Member Avatar for ttqtrang146

These are my examples: [code] /*int WriteFile(const char* file_name) { fstream file; try { file.open(file_name,ios.out); file << "67"; //file << "I miss you very much."; file.close(); } catch(exception& e) { cout << e.what(); return 1; } return 0; }*/ /*int ReadFile(const char* file_name) { fstream file; file.open(file_name,ios.in); if(file.is_open()) { string …

Member Avatar for Nick Evan
0
112
Member Avatar for xiikryssiix

okay, i usually create beg programs and they often compile. for some reason, this one is not compiling at all. i cant seem to figure out whats wrong. my objective is to prompt user to open a file named "data.txt" have HELLO WORLD printed in a scrambled version to a …

Member Avatar for iamthwee
0
206
Member Avatar for cbebop

The program lets the user be the customer, banker, or supervisor, and all of their privileges involve structs. I made an array of 100 structs for 100 potential customers, and I need to do something similar for banking. I'm trying to put customer and banker's info detailed in that struct …

Member Avatar for cbebop
0
150
Member Avatar for Himani_29

hi, as i already discussed in my last thread that my exe is not working for large number of files but it is doing really well with fewer files. today i took a screenshot and got the following error... here is my code..i am even trying to put delay in …

Member Avatar for tux4life
0
121
Member Avatar for nanchuangyeyu

Hi, I am a C++ newbie and had never written even a very simple C++ class before. Now I intend to do such a job. My objective is quite simple, a matrix class with the following features is just OK: [COLOR="Red"]1. The object of such a class can be initialized …

Member Avatar for Ancient Dragon
0
388
Member Avatar for apease11

I can't seem to get [ICODE]ofstream[/ICODE] to use a [ICODE]dynamic name[/ICODE]. It's been bugging me for almost 12 hours now and figured I'd ask it. I have searched the forums and I am doing everything other people have done to make it work for them. Here is my code, the …

Member Avatar for apease11
0
98
Member Avatar for nanchuangyeyu

Hi, My coding objective is quite simple: design a function to write the data in a matrix into files. And here is my code: [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int matwrite(float* mp,int row_sz,int col_sz,string mat_file); int main() { // create a simple binary file first …

Member Avatar for Ancient Dragon
0
189
Member Avatar for NathanOliver

Hi all. i am writing a simple log in program and i would like to have a class for users that stores the user name and the password as strings. after i have a user created i would like to output the class with the ios::binary flag set and store …

Member Avatar for NathanOliver
0
387
Member Avatar for OffbeatPatriot

Basically I'm trying to run a simulation of neurons and this is the code that gets run in the main loop of it. [code=c++] class Neuron { private: double v, u, a, b, c, d, current, du, dv; public: double x; vector<double> pre; int id; vector<int> fired; vector<int*> post; vector<double …

Member Avatar for OffbeatPatriot
0
612
Member Avatar for darkzero89

I'm currently taking a introduction course to C++ and I've been able to do the first 3 assignments without much problems, but this new assignment is kicking my butt. The goal of this program was to make a simple text editing program. I simply open a saved text document and …

Member Avatar for darkzero89
0
276
Member Avatar for kingben

[code=c++] #define MIN_PASS_LENGTH 6 #define MAX_PASS_LENGTH 12 #define NUMBER_OF_PASSWORDS 3 #include<iostream.h> #include<stdlib.h> #include<time.h> #include<conio.h> #include<fstream.h> #include<string.h> //int i; //letters //int j; //numerals char rand_small_letter() { int nHigh = 122; int nLow = 97; int small_letter = ((rand()%(nHigh - nLow + 1)) + nLow); //values from 97 to 122 return (char)(small_letter); …

Member Avatar for tux4life
0
882
Member Avatar for noamco

I have a strange bug in vs2008. ostream open fails when called in the following manner: [CODE=c++]ofstream filestr; filestr.open((filename.c_str()),ios::in|ios::out);[/CODE] when called like this it works without a hitch: [CODE=c++]ofstream filestr; filestr.open("blahblah.txt",ios::in|ios::out);[/CODE] Any ideas? Thanks

Member Avatar for noamco
0
177
Member Avatar for anilopo

i've wrote a code that read and write to some files, and i have a segmentation fault when i'm running it in the g++ (in the visual studio i don't have any problem like that..) anyway, i think the fault may come from this line, can anyone tell me if …

Member Avatar for anilopo
0
87
Member Avatar for whotookmyname

I have to open a file whose name i am constructing by concatenating various inputs from the user. If I write: [code] string s = "filename.csv"; ofstream fout; fout.open(s,ios::app); [/code] it gives error for using s in fout.open(). It says it is a wrong form. I need to use a …

Member Avatar for sureronald
0
88
Member Avatar for _dragonwolf_

Here is my final product: [code] #include <iostream> #include <fstream> #include <iomanip> #include <string> using namespace std; void printGrade(int oneScore, float average); void printTable(int scores[], int id[], int count); float computeAverage(int scores[], int count); const int MAX_SIZE = 21; void readStudentData(ifstream &rss, int scores[], int id[], int &count, bool &tooMany) …

Member Avatar for _dragonwolf_
0
136
Member Avatar for whotookmyname

I have to open a file named "axb.txt" I have user input a and b as strings i have concatenated the string using string str = a + "x" + b+ ".txt" now i need to open the file. it does not open with fopen(str, ios::app) because str is not …

Member Avatar for whotookmyname
0
306
Member Avatar for _dragonwolf_

Okay, so I have my program almost complete. I can get it to do everything except use the computeAverage. I know it works because if I hard code the arrays, I can utilize that and it will work. However, I am having to utilize what I pull from a .txt …

Member Avatar for VernonDozier
0
282
Member Avatar for jcwm249

can anyone be specific with me on trying to figure out this error....I have been reaqding my book and looking all over the net trying to solve it but all i have left is these two errors!!!!!!! [code] #include <iostream> #include <string> #include <fstream> using namespace std; void add_Record(); void …

Member Avatar for Ancient Dragon
0
152
Member Avatar for jcwm249

Ok I am trying to write up a data system on C++ so that when i enter in 1-10 i can choose what i want to do....but I keep on getting errors...and the people i already entered in at the bottom (the void add_record) i dont think it correct because …

Member Avatar for Ancient Dragon
1
242
Member Avatar for mario20055

HI Team, First of all, I'm new to C++, so my knowlege is like 2% and I would like to thank you for any help provided. Well I'm working on a project that looks like this: -- I'm creating an executalble (EXE) that will monitor and create a file into …

Member Avatar for mario20055
0
2K
Member Avatar for zeus1216gw

I need some help getting this factorial to work. I don't think I'm getting this to work right since only the first 2 work in the series. I probably could write a function to fix this but there has to be a way to loop it instead. This is what …

Member Avatar for tux4life
0
174
Member Avatar for arun_354

[code=cplusplus] #include<fstream.h> #include<iostream.h> #include<iomanip.h> #include<stdlib.h> #include<string.h> #include<stdio.h> #include<conio.h> #include<process.h> using namespace std; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { …

Member Avatar for tux4life
0
131
Member Avatar for yun

I want to know that how many Student class objects in a file. plz help me out. Below is a class of Students and 2 function for read and write object in a file, in read function [code] while(in.eof()!= 1){ in.read((char *)&st,sizeof(st)); st.showData(); } [/code] st.showData(); always show the last …

Member Avatar for kvprajapati
0
461
Member Avatar for yun

I m surprised and wanna know that how the compiler understand the sequence of how data was entered. as i didnt use any space any tab not a new line, how it can point to the original value from a single line..????????? find.txt contain the following line with out spaces …

Member Avatar for Ancient Dragon
0
178
Member Avatar for mOoEyThEcOw

So I was coding along working on another dll, I recompiled a dll containing the following code and suddenly my program was crashing, when i clicked the show info link on the 'send this report to Microsoft' dialog box, it said the dll which was throwing the error was msvcp90d.dll, …

Member Avatar for mOoEyThEcOw
1
106
Member Avatar for cout<<"alias"

I have a quick question. I am purchasing an 800 Series Cisco Router. I currently have a WRT54G wireless router for my home network. I am studying for the CCNA exam and i have been needing a Router with IOS and CLI capable. Alright, on to the question. I am …

0
76
Member Avatar for RiceFiend

Hello, I have the Fill, Show, Remove, and Find functions working properly, but I cannot get my WriteToFile function to work. I know that there is a problem involving WriteToFile("Success"); but I don't know how to fix it so that my void WriteToFile function will work. Any help would be …

Member Avatar for RiceFiend
0
257
Member Avatar for begnnr_help

I am running into a baffling problem with my code. I am supposed to write a program to average the test scores for an entire class of students. In each case, the student should have taken 5 tests. You are to average the 5 tests. The program run should look …

Member Avatar for begnnr_help
0
655
Member Avatar for slawted

hello guys i recieve errors when compiling my code [code] #include <iostream> #include <fstream> #include <string> int main() { std::string firstname, lastname, age, emailadress, message; char answer; std::cout << "Hello please imput your first name: "; std::getline(std::cin, firstname); std::cout << "\nNow please enter your last name: "; std::getline(std::cin, lastname); std::cout …

Member Avatar for Lerner
0
218
Member Avatar for lexusdominus

Id like to edit a file. At first i thought this was going to be easy, but now it appears quite complex. As i understand it there is no standard way to delete part of a file? im storing data on different lines in the file, and want to target …

Member Avatar for siddhant3s
0
120
Member Avatar for Niner710

Hi, I am a newbie to C++ and want to know how to parse thru a binary file. I am having some trouble with some simple code. I have a sample binary file(test.bdb) that has "0069 0045 0089 0090" in the file. Here is my code for the file. [code] …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for begnnr_help

I have a problem where I am writing a program that has a predefined costs for tickets. The program asks what city you want to go to and then it asks how many tickets you want to buy and it calculates the cost. If you want more it will ask …

Member Avatar for begnnr_help
0
202
Member Avatar for cruisx

Hi guys, I am making a memory game for my school project and i just have a few things that i would like to add to it to make it better. In my game, i have a 5x5 grid that has letters hidden by $ underneath. So when the user …

Member Avatar for mrnutty
0
180
Member Avatar for CppFTW

I am really stumped with a problem my program keeps giving me. Randomly, a file I try to open returns fail() to ifstream and can't be read from. I have a feeling it has to do with these 2 functions I have been using. Please help. Thanks! PS: I tried …

Member Avatar for CppFTW
0
2K
Member Avatar for cmick56

I guess what i need to figure out is how to do this program. but i need to make the functions call by address. any help would be great. [code=cplusplus] #include <iostream> #include <fstream> using namespace std; int findLarge(int x[]) { int i = 0; int largest = -99999; while …

Member Avatar for ArkM
0
106
Member Avatar for fadia

heey guys.. i'm trying to run this pro but i have one error.. can someone check it please. [CODE=language]#include <iostream> #include<cstdlib> void JOTAKU_LOGO (); //This function calls the flight agency's Logo. void ABOUT_JOTAKUAIR (); //This function displays a briefe history and information about J-Otaku Air. double DOLLAR_TO_YEN (double dollar_Z); //This …

Member Avatar for achied
0
361
Member Avatar for abhishekmadaan

Hi, I am making a program in which i need to append the file from the beginning. so i am opening the file like this wFile.open("sat.txt",ios::ate| ios::out | ios::in); moving the pointer to the beginning wFile.seekp(0,ios_base::beg); but when i try add data it is overwriting the data. Is there any …

Member Avatar for ArkM
0
98
Member Avatar for bjanbkboi

I'm trying to read a file into a vector using structure...[CODE]#include <fstream> #include <iostream> #include <vector> #include <cstdlib> using namespace std; struct StudentRecord { int ID; char FirstName[30]; char LastName[30]; char Grade[1]; }; void read_file(char FileName[20],vector<StudentRecord> &students) { ifstream Students(FileName, ios::in); char S_ID[10]; /* char FName[30]; char LName[30]; char S_Grade[1];*/ …

Member Avatar for ArkM
1
108
Member Avatar for lexusdominus

Hey. I have to say this is the first time ive been totally stumped by c++. I cant exit this loop. this code is from a function that takes a string filename, an int mode, and a char print. It takes a textfile looking like this: somesite.netinfoaboutsomesite someothersite.orgdataonsomeothersite yetanotherrandomsite.edurandomchars and …

Member Avatar for lexusdominus
0
142
Member Avatar for kabeer62

there are blanks in the question as the pro gramme need some codes and definitions to get completed. Please help me in completing this problem. than x in advance. [code=cplusplus] #include <iostream.h> #include <conio.h> #include <fstream.h> //---------------function prototypes----------------------------------------- int menu(); void screenHold(); void enter(); void report(); void save(); void load(); …

Member Avatar for KuriYokan
0
120
Member Avatar for adarshcu

[code=Cplusplus] file.open("1.txt"); file.seekp(pos,ios::beg); getline(file,temp); file.close(); [/code] i ve this small code where temp is string data type. suppose the value of pos points to a location yet to be filled with data, what would be the value stored in temp? is it NULL? temp is not been initialised by any …

Member Avatar for vmanes
0
102
Member Avatar for lss123

I just wanted to post the code I wrote for an OO C++ solution to solving sudoku puzzles. I'd like to invite anyone to ask questions, give comments, or make critiques on the methods or algorithms in the code. For a recent job interview, I was tasked with writing a …

Member Avatar for lss123
0
475

The End.