49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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 - … | |
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 … | |
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 … | |
<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 … | |
how to play mp3 in c++? plz give me some example codes if you can:) | |
| 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 … |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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) | |
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... | |
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 … | |
| 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 … |
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() { … | |
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; … | |
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 … | |
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 … | |
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 … | |
Someone can help me with an example an how to overload operator ->* ? | |
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 … | |
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 … | |
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 … |
The End.