49,757 Topics

Member Avatar for
Member Avatar for pendo826

[CODE]//Header file for Array.cpp. #ifndef ARRAY_H #define ARRAY_H template<class Datatype> class Array { private: //Template for use with the Array's data type. //Member Variables. int size; int grow_size; int num_elements; Datatype* m_array; public: //Constructor. Array( int p_size) { m_array = new Datatype[p_size]; size = p_size; } //Destructor. ~Array() { if( …

Member Avatar for raptr_dflo
0
185
Member Avatar for pushpat

Hi Folks :), I need your help:?:, I am getting segmentation fault for "delete bptr_1" ( please refer program written below and line number 46 ). If i remove statements "delete dptr;" (@line 32) inside try{}, then the program executes otherwise it will give error. Could you please tell me …

Member Avatar for pushpat
0
143
Member Avatar for Karkalash

Hello: How can I improve on my function template to also do insertion sort on strings? I'm afraid I'm very new to templates, any hints appreciated. Template looks like so: [CODE]template <class T> void insSort(T arr[], int size) { T key = arr[0]; int j = 0; for(int i = …

Member Avatar for Karkalash
0
1K
Member Avatar for dakerao

Hello I'm trying to read files of file extension .obj or .txt and for certain characters using boost iostreams How would I implement that using this current code as a basis [CODE] typedef ex::container_source<string> string_source; string input = "hello"; string output; io::stream<string_source> in(input); getline(in, output); assert(input == output); cout << …

Member Avatar for dakerao
0
172
Member Avatar for pattilupwned

Hello, I am just starting out in a basic C++ class and am having some trouble with this problem for class. Any help would be seriously appreciated. In the program, I have to use an input file that includes the name of a college, where the college is located, the …

Member Avatar for m4ster_r0shi
0
218
Member Avatar for HWK1982

hi everybody my problem is when i set timer for ftp to send me a file , the keylogger doesn't log or save any text in log file , i face this problem just when i set timer for ftp otherwise it work fine i mean without timer i set …

Member Avatar for triumphost
0
662
Member Avatar for Johnathon332

How does one simply make a mutator or setter for an array of strings? I have made a inspector or accessor but cant seem to figure out how to make a mutator. much appreciated.

Member Avatar for mike_2000_17
0
673
Member Avatar for triumphost

Is there anyway I can specialize JUST the Contains function of the class below? I tried for hours and cannot figure it out as I'm not too good at specialization but I learned templates recently. I want to do something like: [CODE] bool Contains(string ToFind) { //If typeof(T) == typeof(string) …

Member Avatar for mike_2000_17
0
594
Member Avatar for while(!success)

Hey guys, learning about multi-dimensional arrays and am tracing a code that my teacher gave us, but I'm failing to see or conceptualize it. for instance: Why does the following code output 3? [CODE] int a[2][4][2] = {16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1}; cout << a[1][2][1] << endl; //output is 3 [/CODE] How are the …

Member Avatar for while(!success)
0
297
Member Avatar for daldrome

Hey guys, I'm trying to get my code to compile. I have 3 files: a header file, a cpp file for my main function and another cpp file for my other functions. When I try to compile my cpp function file, I get the error Undefined reference to 'WinMain@16 and …

Member Avatar for kevenm
0
1K
Member Avatar for Swiftle

Hello I built a personal 2D array for my current project. I also store these arrays (called Matrix) in a std::vector. The matrices are 24*181 and currently I sue between 30 and 50 of them. I don't think project details are relevant however I'm getting 3 errors which I have …

Member Avatar for VernonDozier
0
208
Member Avatar for DNA_Monk

Hi all... I have been trying to read a huge file of size around 7 GB. It looks like impossible task now.. The file looks like this: [ICODE] CITY0_084989053<tab>hdewhiuewf CITY1_000989090<tab>AACGTACGT CITY1_000989090<tab>GTACGATAH CITY2_643274032<tab>kdijadadsail CITY3_004498906<tab>Adjbsajdada CITY3_004498906<tab>Adjbsajdada ...... [/ICODE] I expect an output like below with only duplicate left side records. [ICODE] CITY1_000989090#1<tab>AACGTACGT …

Member Avatar for histrungalot
0
154
Member Avatar for s.bolboli
0
51
Member Avatar for FraidaL

Is it possible to loop an if-else statement? How would such a thing be coded. Basically, this code allows the user to enter a value for a month. If it's not from 0-12 it asks the user to enter a new value. How could I get that to go through …

Member Avatar for Tygawr
0
392
Member Avatar for resell4

I bet most of you in here have seen the old movie "Wargames" Im wondering how would you go about programming an AI like WOPR that learns from itself? Lets take an example in chess *Which he loved* He would make simulations of a chess game, if he lost he …

Member Avatar for mike_2000_17
0
189
Member Avatar for CalNChibi784

Hello everyone. I'm a new member here but have an issue that I've searched and searched for and just cannot figure out how to resolve. Based off of the issues that I was able to correct, Daniweb seemed like the best place to ask. I'm making my first attempt to …

Member Avatar for CalNChibi784
0
251
Member Avatar for GuruGhulab

Hello there, okie, my problem today is i i have all this names, [CODE]John, Dave, Steve, Kevin,Andrew,Scott,Colin,Timothy,Zenon [/CODE] and i have to sort them using insertion sort, i can sort number using insertion sort with no probs, but when it comes to strings, and stuff, i get lots of problems. …

Member Avatar for sameershah21
0
3K
Member Avatar for pendo826

My methods dont seem to be working for example void Resize doeznt do anything. AM i using it in the wrong way oris the method faulty. [CODE]//Header file for Array.cpp. #ifndef ARRAY_H #define ARRAY_H template<class Datatype> class Array { private: //Template for use with the Array's data type. //Member Variables. …

Member Avatar for pendo826
0
467
Member Avatar for Shardendu

I was told to make a stopwatch program..but i am unable to figure out how to take come out of loop and pause it and again go back into the loop if resumed ( i tried the pause button on the keyboard and it works) but i have to take …

Member Avatar for NoctiS17
0
302
Member Avatar for triumphost

It reads in the whole file.. thing is, it crashes right after it hits the last line in the file.. the file is 115 lines long.. it prints all 115 lines but for some odd reason, it crashes right after :S If I remove the blank line at the end …

Member Avatar for triumphost
0
249
Member Avatar for bubbleT

Hi I'm new to XML file. I have the following format XML file and I only need to read the value for data name = "A2" in VC++. How to read the value using the XML DOM methods without looping all the nodes? My xml file is as follows: [QUOTE] …

Member Avatar for bubbleT
0
803
Member Avatar for TheFearful

Hey, I am working on a project and I want to know how to return a class object that is a Character Array. I am having trouble with it and can't find out any way to do this. Thank you for taking the time to help (:

Member Avatar for triumphost
0
228
Member Avatar for pseudorandom21

Can I use a DLL embedded in an executable (as a resource) without writing it to the disk? (Windows)

Member Avatar for pseudorandom21
0
1K
Member Avatar for pseudorandom21

I'm attempting to transfer some OpenCV images over the network, I've been trying to put them into a format I can easily encrypt and transfer, but I'm almost certain it's not going to work properly. Essentially the IplImage is a structure but it has a pointer that points to some …

Member Avatar for pseudorandom21
0
766
Member Avatar for coolbits

I want to create a struct array and get the max number of books written by particular author...The problem is that i can't get the number. I am not finished up yet with the code,but i don't know why i am not getting anything when calling the Max function.Please advise! …

Member Avatar for coolbits
0
144
Member Avatar for ClausL

Hi guys, Found this thread while searching to solve my problem ... anyone an idea why this snipet leaks? [CODE]void testMemoryLeak() { HINTERNET hSession = WinHttpOpen(NULL, WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0); WinHttpCloseHandle(hSession); } [/CODE] a 20'000 loop brings memory up to 19MB VS2008 on Win7/64 building a console application Win32 Cheers …

Member Avatar for Ancient Dragon
-1
77
Member Avatar for xtinab

For a project I'm doing for class I have to make a virtual method in a class. A subclass will inherit the virtual method and instantiate it in a separate .cpp file. The problem I'm having is that I need the class that has the virtual method to instantiate its …

Member Avatar for Ancient Dragon
0
219
Member Avatar for rigoalhn

I need help with this assignment. I got some done for the input validation but im having problems to understand classes. Ill provide the code below. Design a class called Date that has integer data members to store month, day, and year. The class should have a three-parameter default constructor …

Member Avatar for Ancient Dragon
0
3K
Member Avatar for fredz0003

[CODE]int initScoreX; int initScoreO; int oldScoreX; int oldScoreO; int newScoreX; int newScoreO; int ScoreBoard(char Player) { int ScoreBoardPositions[99]; //counting all the way to 99 //let's say X won that round, so I add 1 to the old score oldScoreX + 1 = newScore; //let's say the new score is 16 …

Member Avatar for WaltP
0
113
Member Avatar for mohy93

i need help with this program, i need to give the user 20 chances to guess, and they should be asked if they want to playagain.(by playing again i mean generating a new number with 20 new chances) after playing for how many times i should count the number of …

Member Avatar for WaltP
0
211

The End.