49,761 Topics

Member Avatar for
Member Avatar for Rez11

I am trying to replace "the" with "that". My original sentence is "the ball is under the car". I can successfully change the first "the". But when I try to change the second "the" string1 ends up being "that ball us under that".So it cuts off the world "car". What …

Member Avatar for StuXYZ
0
203
Member Avatar for Vani3863

Hi All, I'm a relative newbie having trouble completing a program that is required to read the text character by character from a .txt file and to then encode certain characters to something thing else. It is then supposed to be output to a separate .txt What seems to happen …

Member Avatar for Vani3863
0
159
Member Avatar for tehmarto

Hi all, I have a program that loads a dll, uses it for some time and then it unloads it. I have no idea where dll is located or from where it is loaded but I know where dll is unloaded. Loading of the dll is very hardcoded and I …

Member Avatar for tehmarto
0
130
Member Avatar for effizy

I am new to C++ or any form of programming language. Would appreciate any practical tips on: - approaching problems - techniques on writing codes - rule of thumb for writing codes - fixing errors - how to define and use(call) functions - loop - array - float, double - …

Member Avatar for Jackk123
0
136
Member Avatar for xiansen

i am supposed which accepts a five-digit integer value. my program is then to output the digits, one per line. Each line of output should contain the digit value, its square and its cube. Once I have the program running correctly, modify the program so that it will process as …

Member Avatar for xiansen
0
266
Member Avatar for ticktock

Hey all, I am trying desperately to create a cube using VBO. I have the correct vertices that must be used yet when I render it, it only displays one part of the face of the cube (which in this case is a half triangle, since a square is made …

Member Avatar for ticktock
0
2K
Member Avatar for neural_jam

<edit>(scroll down a bit to avoid some rambling and get to the main question!)</edit> Hi there, I'm trying to write a C++ program that repeatedly executes another program (with a system call) that creates a file called 'output', then copies the output into a subdirectory and renames it so that …

Member Avatar for neural_jam
0
164
Member Avatar for y2kshane
Member Avatar for Stefano Mtangoo
0
153
Member Avatar for embooglement

I'm trying to write a to string function that would use std::stringstream to convert the the instance data into a string, but haven't been able to get operator overloading to work with it. As soon as I define a new << operator, I get a bunch of ambiguity errors saying …

Member Avatar for embooglement
0
2K
Member Avatar for low_coder

hey, im making a database program using standard c functions (fopen, fclose...) and i need to read and write data to files quite frequently, so is it better to open (fopen) and close (fclose) the files before and after each operation or open the files at the beginning of the …

Member Avatar for low_coder
0
98
Member Avatar for aikiart

Good day, I've got a question about why program 19-3 won't display a returning message but program 19-2 will. THIS IS 19-2 // This program demonstrates a simple recursive function. #include <iostream> using namespace std; // Function prototype void message(int); int main() { message(5); return 0; } //************************************************************ // Definition …

Member Avatar for aikiart
0
266
Member Avatar for abysss

I am new to thread programming,i basically want to learn how write threads in c++.It would be a great help to me if anyone could guide me through this or provide any tutorial links. thanks in advance sidharth

Member Avatar for abysss
0
143
Member Avatar for pdk123

Hi , Sorry for this basic question, i am stuck, with somethings, I have a class class A{ int * mem_ptr; } then somewhere in the code: if ( mem_ptr == NULL ) { mem_ptr = new int; } Is it safe to assume that mem_ptr is NULL when the …

Member Avatar for wtf4096
0
146
Member Avatar for jonymanolo

i have a big code in c++ and i need do a little change i have the src but when i do a change in the .sln file an try to compile again send me errors about the dlls and other stuff what i need to do? the change i …

Member Avatar for yusuf0024
0
62
Member Avatar for RayvenHawk

Ok I'm working on a DirectX project for an augmentation class and have a quick question. I'm needing to recognize a key being pressed (for example "s) which triggers action (x). I then need to press "s" again to then revert back to the original state. Currently I have an …

Member Avatar for Fbody
0
195
Member Avatar for DavidNeedsHelp

Hi All, I'm getting a segmentation fault that I simply cannot understand. I run gdb and get the following message: Program received signal SIGSEGV, Segmentation fault. 0x00000000004a91a5 in BDD::BandB (this=0x7ffffffe4e60, fixedVars=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece. ) at BDD.cpp:550 550 void …

Member Avatar for Fbody
0
184
Member Avatar for dorien

Hi, I have been reading a number of posts about this, but I have not been able to figure it out. I want to write hex to a midi file. The hex code of the midi file looks like this: [CODE]4D 54 68 64 00 00 00 06 00 01 …

Member Avatar for dorien
0
9K
Member Avatar for 333kyle333

The title explains it. I'm running Ubuntu Linux if it matters. I want to be able to take input and pass it to the terminal (bash shell)

Member Avatar for NicAx64
0
83
Member Avatar for raghamayee

Hi everyone, I have written a program which can be performed in two ways...now,i want to compare the times taken by both approaches...can anyone help me how to get it...

Member Avatar for mike_2000_17
0
142
Member Avatar for techie1991

I was having some confusions about string and NULLs. So, I read this [URL="http://www.daniweb.com/forums/thread77987.html"]thread[/URL] on this very forum. But, I could not understand somethings... Firstly, Is NULL an integer value 0, or something else? Secondly, [CODE]if(strlen(str)==0)[/CODE] this shows that the string is null or it shows that the first character …

Member Avatar for Ancient Dragon
0
158
Member Avatar for Rkeast

I've been kicking around the idea of doing a 3d game in my spare time, but I am struggling when it comes to actually setting up an application from scratch in such a manner that the different aspects of the application are separated into different projects in my IDE. I …

Member Avatar for Ancient Dragon
0
171
Member Avatar for daviddoria

Can anyone explain why this doesn't work? [code] #include <iostream> class Parent { public: virtual int Add(int a, int b) = 0; int Add(int a) { return this->Add(a,a); } }; class Child : public Parent { public: int Add(int a, int b) { return a+b; } }; int main() { …

Member Avatar for mike_2000_17
0
213
Member Avatar for pspwxp fan

I'm learning C++ from the book C++ Primer Plus. At the end of the chapter on loops, they want us to design a structure, allocate adequate memory for an array of such structures using new, then feed input data to it. I got this code: [CODE]#include <iostream> using namespace std; …

Member Avatar for embooglement
0
134
Member Avatar for darkroad

Assuming that we enter the integer value is 5689798. Summing up the digits gives 5+6+8+9+7+9+8+8 = 58 that contains more than one digit, so we repeat the process: 5+8 = 13. we repeat until we got one digit: 1+3 = 4 . The final answer is 4. I don't know …

Member Avatar for ananda2007
0
165
Member Avatar for ^Y^ nobody ^Y^

Hi, I'm trying to make a program that search strings in a file and output them (or others). My problem is, how to output a file line !? Here is my code... [CODE]string str; string str2 = "hate"; int i; ifstream file ("file.txt"); for (int index=1; index<=10; index++) { getline …

Member Avatar for amrith92
0
143
Member Avatar for badboy11

I need some help understanding how the exception handling flow of code works. I have written a sample program that has exception handling in it. There are two classes here: My custom Array class and the Main.cpp class to implement and test the Array class. Inside the main() method, I …

Member Avatar for badboy11
0
138
Member Avatar for vbx_wx

Someone can help me with an example an how to overload operator ->* ?

0
37
Member Avatar for tarakant_sethy

I do have some doubts and i need help from you. When we call a function which is virtual from a base class pointer to which the address of derived class object, it sees where vpointer, from vpointer it gets the address fo virtual table, manipulate offset and call the …

Member Avatar for sanjeevarao
0
86
Member Avatar for EdAtTheAirport

This is from the book: [I]C++ Weekend Crash Course[/I], pg 142. It is designed to concatenate two strings, and put a hyphen in the middle. It compiles; it works, but I don't understand why it works. The two strings are entered in main() as szString1 and szString2. During execution, they …

Member Avatar for arkoenig
0
187
Member Avatar for Duki

Can someone remind me why I can't do this: [code=c++] int s = b.Activate(war.get_tp(), damage, 50); //prototype int Activate ( int &tp, int weaponDamage, int attack ); [/code] I get an error at war.get_tp(). It says cannot convert param 1 from int to int&. I need it to be a …

Member Avatar for Duki
0
177

The End.