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