51,593 Topics

Member Avatar for
Member Avatar for vavazoom

[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 …

Member Avatar for vavazoom
0
171
Member Avatar for shanker86

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 …

Member Avatar for shanker86
0
431
Member Avatar for Acidburn

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

Member Avatar for Nirvin M
0
238
Member Avatar for Erslich

Hi all :) I'm having a few problems with this assignment I'm working on. Its a Java - C# conversion of a Mandelbrot program. What I'm trying to do, is draw the Mandelbrot to a Bitmap, and then print it onto the Windows form. So far I've been able to …

Member Avatar for Chrisakak9
0
623
Member Avatar for anurag143

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

Member Avatar for kuriakosebabyk
0
166
Member Avatar for jessikwa

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, …

Member Avatar for jessikwa
0
4K
Member Avatar for Kontained

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 …

Member Avatar for Kontained
0
3K
Member Avatar for coding101

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???

Member Avatar for coding101
0
64
Member Avatar for bigwhiteegg

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 …

Member Avatar for Ancient Dragon
0
138
Member Avatar for jpetrey

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> …

Member Avatar for Ancient Dragon
0
957
Member Avatar for cortez716

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 …

Member Avatar for cortez716
0
167
Member Avatar for Urv73

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 …

Member Avatar for Urv73
0
194
Member Avatar for ezkonekgal

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 …

-1
107
Member Avatar for tKc

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 …

Member Avatar for Ancient Dragon
0
476
Member Avatar for vbx_wx

How can i calculate an expresion of type string: [code] strng eval = "129 + 23 - 54 * 2 / 4"; [/code] Any ideas?

Member Avatar for bunnyboy
0
94
Member Avatar for Blitze

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 …

Member Avatar for Blitze
0
97
Member Avatar for RobBobSmith

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 …

Member Avatar for Fbody
0
186
Member Avatar for LevyDee

[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] << …

Member Avatar for Fbody
0
115
Member Avatar for Blitze

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 …

Member Avatar for Blitze
0
134
Member Avatar for jeffcogswell

[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 …

Member Avatar for jeffcogswell
5
319
Member Avatar for NordCoder

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 …

0
75
Member Avatar for pstrohma

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 …

Member Avatar for pstrohma
0
264
Member Avatar for manny c++

: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 …

Member Avatar for Alexkid
0
425
Member Avatar for malvi

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.

Member Avatar for MrSpigot
0
175
Member Avatar for bmos31

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 …

0
89
Member Avatar for Alexkid

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 …

Member Avatar for Alexkid
0
2K
Member Avatar for hzp

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 …

Member Avatar for hzp
0
125
Member Avatar for uspanday

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 …

0
49
Member Avatar for ranko_6

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 …

Member Avatar for ranko_6
0
208
Member Avatar for DonutsnCode

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 …

Member Avatar for DonutsnCode
0
129
Member Avatar for samsons17

Hi.. I am trying doing this exercise.Which is require a program that could ask the user how many integer he/she want to enter,and allow him/her entering them thus lastly display them all back. i could just simply doing it by using an array,but this time i wanna use a vector …

Member Avatar for Narue
0
123
Member Avatar for stereomatching

I am using the library of boost to create a 2D dimensions array and compare about their speed There are three kinds of array, matrix of boost, multi_array of boost and the raw array Below is my code: [code] #ifndef TESTRELMAT_H #define TESTRELMAT_H #define BOOST_NO_EXCEPTIONS #define BOOST_DISABLE_ASSERTS #include <boost/numeric/ublas/matrix.hpp> #include …

Member Avatar for Narue
0
141
Member Avatar for Varnius

I started learning Winsock (2.2) programming in university recently and when writing my first program (fileserver and its client) a few questions came to mind. Let`s assume my fileserver is continuously listening for client connections and when one occurs it establishes connection, does whatever client wants (such things as list …

0
119
Member Avatar for moonL!ght

hi every one im working with some exersies which include inheretence every thing is fine except that the compiler dose not recognize the base clase it says Error [COLOR="Red"] Cannot open include file: 'pointType.h': No such file or directory[/COLOR] here is part of the code [CODE] # include "pointType.h" # …

Member Avatar for chiwawa10
0
132
Member Avatar for bbman

alright, I'm a bit stuck here, I've tried a few things but I can't figure it out. Question is in the source: [code=c++] // test.h namespace test { class foo { static void test(); }; } [/code] [code=c++] // test.cpp #include "test.h" namespace test { // how can I define …

Member Avatar for bbman
0
132
Member Avatar for XMasterrrr

like the thread title said i need the best C book for never programmed person can you please tell me it thanks....

Member Avatar for elsiekins
0
173
Member Avatar for Christ1m

The book Im using. Pg 108 - 124 Objects Abstraction, Data Structures and Design using C++ Author: Elliot Koffman and Paul Wolfgang I have a problem with this code. All of these errors are occurring in the Phone_Directory.cpp. It is in, getline, << , out. .......functions... I tried getting these …

Member Avatar for Intrade
0
215
Member Avatar for DonutsnCode

Hi friends, I'm learning to program in C++. I'm using Notepad++ to author my code and Cygwin g++ to compile it. [QUOTE]main.cpp : in function 'int main() : main.cpp : 38 : error: no match for 'operator << ' then a lot of jibberish and number of errors : 1 …

Member Avatar for DonutsnCode
0
139
Member Avatar for itpipx

#include<iostream.h> class Exforsys(); { private: int a; public: Exforsys() {} Exforsys(int w) { a=w; } Exforsys(Exforsys& e) { a=e.a; cout<<"Example of Copy Constructor"; } void result() { cout<<a; } void main() { Exforsys e1(50); Exforsys e3(e1); cout<<"\ne3="; e3.result(); } }

Member Avatar for itpipx
-1
134
Member Avatar for ashtonpearson

// Ashton Pearson, 558771747 // // This program reads an integer and determines whether // or not it is a perfect integer. #include <iostream> using namespace std; int main() { int x; int iCount = 1; int sum = 0; cout << "Enter an integer to test (< 2 to …

Member Avatar for ashtonpearson
0
73
Member Avatar for banks2140

I need help with my C++ homework and im stuck. The problem is to write a program that reads a file of all lowercase and output each letter and how many times each letter occurs.... Here is the code i have and where i am stuck.... #include <iostream> #include <string> …

Member Avatar for Fbody
0
106
Member Avatar for harpay

This is my code for my program, it seems to work fine but the problem is i think roll has to be a char in order for q to quit to work when i implement the code in there. but when i use char, when i input the number i …

Member Avatar for emilo35
0
290
Member Avatar for Centz

I need to make a program that asks the user for their name and PIN number, then have it check the accounts file and see if that user is in there. If it finds a match it will output the users account balance. I have the text file set up …

Member Avatar for acerious
0
257
Member Avatar for YingKang

The main function looks so messy. I am wondering if there is a way I can move some of the code from the main function to Student.cpp. Could anybody help please? Thanks. [CODE] //main #include <cstdlib> #include <iostream> #include <iomanip> #include "Student.h" using namespace std; int main(int argc, char *argv[]) …

0
67
Member Avatar for gretty

Hello I have this task below & I need someone to tell me if I have done it correctly. The part where I am not sure is if I am correctly checking if the array is empty. [quote]Write a function to find the maximum value in an array of ints …

Member Avatar for Akill10
0
156
Member Avatar for martin_anastaso

Hello all, I have encountered a very bizzare (at least for me) problem when writing the output from my program to a file. I've written a program to solve numerically mean-reverting SDEs. The program takes some parameters and returns several dynamic arrays corresponding to the number of SDEs I have. …

Member Avatar for martin_anastaso
0
1K
Member Avatar for abhishekrs
Member Avatar for a-hall

I have setup an array and i have calculated the sum of my array. Now i need to find standard deviation of the numbers entered in my array. here is my code [CODE]#include <iostream> using namespace std; int main() { int i=0, count, maxSize = 36; double arr[36]; double number; …

Member Avatar for Fbody
0
144
Member Avatar for sanjuanair
Member Avatar for Narue
0
125
Member Avatar for glenak

Hi, So I've been having problems with my Eclipse C++ IDE. In other words, I haven't been able to run anything, not even a hello world program. I think the problem has to do with the fact that I don't have a c++ complier in my system. I use Windows …

Member Avatar for glenak
0
154

The End.