49,755 Topics

Member Avatar for
Member Avatar for sara90

hello every one, i have a problem in parsing a text file this is a sample text file: 6 1 1 + 3 4 5 + * 3 4 5 * + 1 + 1 1 1 + 2 3 8 2 / - 1 + * the first line …

Member Avatar for VernonDozier
0
97
Member Avatar for marrkee

Hello, I'm new to c++ and i'm making program to read from numbers from file and calculate average. The numbers in file is like this [CODE]10; 15; 200[/CODE] and my source so far [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int main () { string line; ifstream …

Member Avatar for marrkee
0
118
Member Avatar for eman 22

Hi,All I'm now working in project to compress a files. And I used Huffman encoding to get new code for each character in the site. but now I can't complete my project. How can I use bitwise operation to put all those new codes into the compression file. and Also …

Member Avatar for eman 22
0
554
Member Avatar for davelee

Hi, I am writing a student database in C++. There comes a point in my program where I have a succession of "cout's" requesting the user to input the students grade for a particular course. I want to check that the input is not less than 0 or greater than …

Member Avatar for davelee
0
1K
Member Avatar for Buffalo101

Hello, I want to code an application that calculates a program's complexity. I may have put this the wrong way: I want to count the operators, variables, function calls etc. in a C/C++ program. At first I thought about reading the .C file as a .txt file, looping through each …

Member Avatar for Buffalo101
0
106
Member Avatar for Osas106

good day every one i am osagie by name, i've been trying to develope a biometric(fingerprint) software in win32 that will serialise and save all user fingerprint record to a binary mode cpp file(after due analysis). Thereafter, d program is expected to send a copy of the serialied file to …

Member Avatar for jonsca
0
129
Member Avatar for MicroBanned

Hi there, I am wondering what I am doing wrong ss when a user inputs anything on the 10th row..the 'X' char is misplaced :s Also, I cannot seem to limit the user from inputting BEYOND the board..I feel like I've taken a wrong step somewhere. Thanks once again :) …

Member Avatar for MicroBanned
0
86
Member Avatar for broli100

Hello, I am doing simple program with Visual Studio and I am using System.Windows.Forms. It has DataGridView, which represents sudoku board. Everything goes OK, but when I manually edit some cell, then the program crashes and throws some exception, which has something to do with unproper conversion of types. Here …

0
62
Member Avatar for cookiemonstah

I need help on making an isosceles triangle 2sides with 5 asterisks, and a base with 9 asterisks, and has no asterisks inside the triangle. I've come up with the codes on a 2sides with 5 asterisks and the base with 9 asterisks, but this time, it has asterisks inside …

Member Avatar for sfuo
0
193
Member Avatar for Skabix

I am converting seconds to minutes, hours, days. For some reason I have an issue with the days not calculating when running the program. The 'if' statement seems completely ignored by the program. I think this may be caused by the warning I get. Any help would be greatly appreciated …

Member Avatar for Skabix
0
1K
Member Avatar for murnesty

I searched from internet. They said have 2 ways to create sub-function file, first way is : using header file which is easier to write. second way is: using cpp file which will increase the compilation time. But my lecturer say using header file to write sub-function is a wrong …

Member Avatar for Ancient Dragon
0
150
Member Avatar for boliviano3

I'm having a couple of problems w/ getting the program to end when the user enters 'Q' after they've been asked if they want to try again. Also, after enter a negative int is entered for employee id then either the program moves to displayEmployeeInfo & shows the info that's …

Member Avatar for boliviano3
0
170
Member Avatar for cafegeo

I am writing a program that accepts an input file of 10 items each having revenue across 4 quarters. In this particular function I have to determine if the items profit has steadily increased, decreased or went up and down across the 4 columns, or quarters(qu) as they are referenced …

Member Avatar for VernonDozier
0
2K
Member Avatar for g-pita

Hi I'm trying to create a program that gathers data from some ADC connected and do some averaging on the data. It's build up around classes containing systeminterface and sensors making a datamodel. The program is pretty big, but has worked intil implemention of pthreads I wanted to create a …

0
113
Member Avatar for cableguy31

I'm having a problem writing an unsigned char array to a file. When I write it to stdout using printf, it displays properly, however if I write it to a file, when I open it, I can't read the file. It looks like it may be writing the file in …

Member Avatar for Narue
0
722
Member Avatar for bops

How would one read an encrypted file's (encrypted using windows' EFS) header? I would like to be able to read the header and extract FEK that was encrypted by either the public or private key of the file. From reading up I understand the structure of the file header I'm …

Member Avatar for grehe
0
466
Member Avatar for pengkeanh

Hi All, I am working on optimizing the memory usage of my codes and I found a problem that I do not understand. Please let me know what you think. Code: [CODE]typedef map <pair<string, int>, vector<pair<int, float> > > TDM; void parsefile (TDM & my_map, string in_file); // parse input …

Member Avatar for Aranarth
0
283
Member Avatar for ichigo_cool

I'm working on a map editor and the tiles show up i a file as [CODE]1, 0, 0, 1, 1, 0, 1, 1[/CODE] so here's a 4x2 map. I'm wondering how can I parse out the integers from the commas and assign them to a multidimensional array so that \i …

Member Avatar for ichigo_cool
0
4K
Member Avatar for shyla

my question is: Write a function that accepts an integer parameter and returns its integer square root. The function should throw an exception if it is passed an integer that is not a perfect square. Demonstrate the function with a suitable driver program. i am getting that : Error 1 …

Member Avatar for shyla
0
2K
Member Avatar for cableguy31

First, yes this is a school project. That said, I have a seed, now I need to create a function that will create a byte array of random bits. The input for the function should be the number of requested random bits. Here's an example: [CODE]unsigned char* getRandomBits (int number);[/CODE] …

Member Avatar for cableguy31
0
133
Member Avatar for afnan92

hello i am new to this forum i am basically stuck with this programme and i need help....it is a brick game....i want to move the ball and slider at the same time without using threads....i am allowed to use the gotoxy function arrays and pointers thats it can anyone …

Member Avatar for WaltP
0
81
Member Avatar for cableguy31

Is there a way to gather network/internet traffic statistics? The end result is that I need to create a random number generator using some network stats as a random seed, so I need to pull information that is highly variable. Could be packet data (maybe sequence numbers), or traffic data …

Member Avatar for cableguy31
0
303
Member Avatar for Stogie2

I am looking for the correct way to initialize an array data member and why the following code produces the listed error. Thanks... [code] typedef struct tagsX { tagsX(int u, int v): a(u), b(v) {} int a ; int b ; } sX ; typedef struct tagsY { tagsY(sX *p, …

Member Avatar for Stogie2
0
208
Member Avatar for Wakesta

Someone help/direct me to understand where I have made the below errors from the build report? [CODE] #include <iostream> using namespace std; int main() { } void "welcome_screen"() { clrscr(); textcolor(RED); gotoxy(10,10); cout<<"**************** W E L C O M E *********************** "; gotoxy(15,12); cout<<"*** T O M A N C …

Member Avatar for Wakesta
0
204
Member Avatar for merse

Hi everybody, I have a simple mathematical member function of a class: [CODE] struct shell { double mc, ms, r0, v0, a0, w; shell(double mc, double ms, double r0, double v0, double w); double absv(double r) const; }; shell::shell(double mc, double ms, double r0, double v0, double w) { this->mc …

Member Avatar for Narue
0
158
Member Avatar for Howdydoody

Im having some problems with using the vector pushback method through a structure. The push back method works in one part of the code and not the other. Ive been staring at it for hours and testing different things and i cannot get it to pushback in the section of …

Member Avatar for Howdydoody
0
406
Member Avatar for vbx_wx

I'm trying to print all .pdf files from a partition using Boost.Filesystem and Boost.Regex but when I run my program, Visual Studio 2010 gives me an Abort error. Here is my code: [code] path Path = "e:\\"; boost::regex reg("*.pdf"); for(recursive_directory_iterator it(Path); it != recursive_directory_iterator(); ++it) { if(boost::regex_search(it->string(), reg)) { cout …

0
54
Member Avatar for Narue
Member Avatar for stobbz

[code=c] . . string line; vector<string>DataStore; ifstream file; file.open(fileName.c_str()); if (!file.is_open()){ cout<<"Error retrieving file " <<fileName<<endl; } while(getline(file,line)) { getline(file,line); stringstream lineStream(line); string bit; getline(lineStream, bit, ','); getline(lineStream, bit, '\n'); DataStore.push_back(bit); . . [/code] This piece of code takes a CSV and stores its data in a vector. The first …

Member Avatar for stobbz
0
4K
Member Avatar for rannamaa

In Java and c# you can get the total lenght of an array with array.length or simular. Not only the length of the filled elements, I want the length of the total array. Lets say the array is introduced as this. [CODE]string array[100];[/CODE] Maybe its half filled or not it …

Member Avatar for rannamaa
0
114

The End.