49,761 Topics
| |
Ok, I have a huge program and I ran it today and found that its using 100% of the CPU and bogging down the system to such a degree moving the mouse is an effort - let alone opening a window. I've been trying all day to narrow down the … | |
[CODE] #include <iostream> #include <fstream> using namespace std; int main (int argc, char* argv[]) { int length; char * buffer; string searchWord = argv[2]; string compareStr; int searchSize = searchWord.size(); ifstream readFile; readFile.open (argv[1], ios::in ); ofstream writeFile; writeFile.open("newData.txt", ios::out); readFile.seekg (0, ios::end); length = readFile.tellg(); readFile.seekg (0, ios::beg); buffer … | |
Hi all here is my pair.h file which when I run using g++ on linux I am getting error like "pair.h:39: error: expected constructor, destructor, or type conversion before ‘ostream’" any help would be greatly appreciated! Thanks WRAP template <class T1, class T2> class pair2 { private: T1 first_; T2 … | |
Hey guys, Just wondering how I check for the space bar input...since my program doesn't seem to want to know when I hit the space bar..... It just outputs a space on the konsole window and then hitting enter makes a new line... cheers John | |
Hello Friends, my name is Anurag.. am doing MSC(Comp. Science) I need some excellent Project Ideas to develop in VC++ (or C++) Something which is of more developing technology from INDUSTRIAL POINT OF VIEW.. with Problem Description I would be thankful to u people Please help Byee | |
Trying to write a program for my C++ class. Basically; call a function getJudgeData five times within the main function to get five different scores. Send the scores from getJudgeData function to calcScore function. From there use two more functions, findHighest and findLowest to find the highest and lowest score, … | |
Hi all, I'm currently working on a RC4 project for my computer security class. I have looked at the [URL="http://en.wikipedia.org/wiki/RC4"]wikipedia page[/URL] for RC4, and I'm trying to adapt that algorithm to my problem. I can get the correct encrypted text when I just cout the values. However, when I try … | |
why cant i use fstream on mac i have a stuff.txt file one the desktop psuedo #include<fstream> ifstream in; ofstream out; in.open("stuff.txt"); if(in.fail()){ cout<<"failed"; } failing WHY??? | |
the following are my program since it's not large, it might be alright to post the entire code? anyway... it is the deallocate() causing the crash at the end of the program for some reason, it did not panic in the grow() function am I supposed to do something after … | |
i am reading in data from an input file and sorting it as it comes in. (ive done this before just without sorting so i know everything else works fine.) [code=c] StringTable::StringTable(ifstream & infile) { // TODO: complete string s; vector<string> row; vector< vector<string> >::iterator srow = table.begin(); vector< vector<string> … | |
If you are viewing my post, thank you for taking the time to hep me out. It is greatly appreciated. Here is what I'm trying to do: Write a function called Square2 that will take as arguments an integer and a double. With the use of references i want my … | |
Hi, I'm trying to make a program that lets a user punch in the results from a race. What I got is a loop for entering the contestants startnumber, the time they started the race (hh, mm, ss) and when they finished the race (hh, mm, ss). I'm stuck with … | |
i'd like to ask if to is calculate the turn around time of a particular process is: turn around time = burst time - arrival time ?? and what about response time and waiting time? like in a preemptive scheduling where a process is preempt when a new process enters … | |
I need help in reading a text file and by using a switch statement the user can either press 1 to find the average of all the integers in the text file, and by pressing 2 they find only the averages of the real numbers (only positive integers) in said … | |
How can i calculate an expresion of type string: [code] strng eval = "129 + 23 - 54 * 2 / 4"; [/code] Any ideas? | |
Hello, I used to code in python and I recall being able to take a class such as the list class and add my own functions to it. I am not quite sure what this is called in c++ or how to do it, so I was just wondering if … | |
Hello all, I would be grateful for some help with a function template problem. I cannot figure out how to pass a matrix as an argument in a template function. I keep getting the error "does not match any template declaration". Can anyone suggest what my problem is? Have I … | |
[code] MonthNames[0] = "Januaray"; MonthNames[1] = "Febuary"; MonthNames[2] = "March"; MonthNames[3] = "April"; MonthNames[4] = "May"; MonthNames[5] = "June"; MonthNames[6] = "July"; MonthNames[7] = "August"; MonthNames[8] = "September"; MonthNames[9] = "October"; MonthNames[10] = "November"; MonthNames[11] = "December"; for(int n = 0; n < 12; n++) { cout << MonthNames[n] << … | |
Hello, I am in Object Oriented Design for C++ at the moment... The test we are having has a question on it and the professor wants us to find and know the answer before we come in for the test. The question is this: The following code out puts what … | |
[ATTACH=left]17191[/ATTACH]Today at Intel's IDF 2010 was the official launch of the 2011 version of Intel Parallel Studio. Parallel Studio is a set of tools that enhance Visual Studio to support full parallel programming. This is more than just a simple plug-in for Visual Studio. It's an entire set of tools … | |
Hi Daniweb, I doing an assignment for a course I'm taking at my university. The assignment involves using the Boost Graph Library (version 1.43). So far, I haven't had any trouble at all. Then I tried calling dijkstra_shortest_paths(...). The named parameters way of calling this function does not work in … | |
Hello all, Does VC++ Express 10.0 even support the ability to get text from a text box? I've seen related threads having conflicting solutions, none of which actually work. Ex: must have SDK version x.y. This functionality seems to be so basic and necessary that solutions would be all over … | |
:cool: Hi all I have fingered out how to check the users input for their first and last name This works fine. If the user enters a number for their name they resave an error message. But it only works for the first letter How do I increment the check … | |
Hello.. I want to block/disable each and every message box, generated by system. ie. Edit box is numeric, and when it is empty, it will generate error box, "Enter a number". can anyone help me in this? Thanks. | |
I'm trying to write a program that prints out Euler's triangle as follows: 1 1 1,1 1,4,1 1,11,11,1 1,26,66,26,1 1,57,302,302,57,1 1,120,1191,2416,1191,120,1 It uses the following formula, where A is a vector of vectors: A[x][y] = (x-y)A[n-1][m-1]+(m+1)A[n-1][m] I've already implemented the formula to the function I've created to printEulersTriangle(), but it … | |
Hi there, Can anyone tell me why variables can have printed values of -858993460. I've got a pointer pointing to a memory address which has nothing in it so when i come to cout this it prints -858993460, if i give it a value then its prints that value. I … | |
hello everyone i am new to this community . i am having a problem right now with arrays. So basically this program let user to enter anything in lowercase and then convert it to uppercase(if user input uppercase it will stay the same). Because i am not allowed to use … | |
hi, I have many images. Per image, I have a set of lines called wireframe and every wireframe has many other lines extracted from images. I want to create a data stucture to store Image-Wireframe-Ext_lines Triplet. I am not getting any error but output is not expected. Can anyone help … | |
Trying to write a simple program that will read data but keep stumbling upon the fact that I kinda can't limit the amount that is read. I have simple student.dat file which is filled ATM with nothing else but simple string "somethinginside", without quotes. When I do this on each … | |
I'm using cygwin g++ to compile my code and Notepad++ as my editor. The code i authored works fine if i implement member functions in the class definition .h file. However g++ throws a chunk of gibberish at me when i replace member functions with function prototypes in the class … |
The End.