49,757 Topics
| |
Hello having some issues with my logic. I have to write a function that determines whether a given string is palindrome. I have to use multiple stacks for implementation. I have began coding and it compiles however it is not working correctly. I think the problem is within my while … | |
A couple days ago, I was involved in [URL="http://www.daniweb.com/forums/thread258996.html"]this thread[/URL] which concerns bit shifting (kind of) and a solution was found (by someone else). The problem is, something about the solution never really sat right with me. Hopefully someone can clarify this for me. [B]Code:[/B] The code uses 1 constant … | |
I'm a relative beginner, taking a c++ class, and I'm trying to output this stream of numbers to a .txt file. I'm having no problem actually getting them into the file, but I can't figure out how to get the numbers to line up in columns or rows instead of … | |
Hi, I'm searching for an XML streamming parser, but I dont know wich one I must use. I have to parse very large files, and i need to use threads because i need to do some things before the parsing of all the file has finished (that's what a streamming … | |
I use mfc. Is it possible to serialize member variables in the view class? | |
I want to find the determinant of a square 4x4 matrix using a minor and cofactor. And I want those in three seperate functions where i is the number of rows and j is the number of columns: [CODE]double minor(double a[][4], int row, int column);[/CODE] Done by removing a row … | |
I've got this annoying "access violation" problem. I've done searching for a whole day on the Internet and although I didn't find any solution specific to my problem I do understand "unhandled exception in abc.exe:0xC0000005: Access Violation" has something to do with inappropriate use of pointers. However where the error … | |
I have c++ functions in which all the arguments are integers....I was wondering if there was a way of telling the computer this, other than typing int before each and every variable....I tried function S(int a, b,c..) but did not work.... | |
Hi All, what is method to get all availabled disk drives and their status. By status I mean whether they are hard disk or CD/DVD or USB? Also how to get list of Drives in *nix? Thanks a lot | |
hello, im making IRC clients with both C++ and Java SE. i've come across a peculiar problem when i send the message using my program (or when sending it using telnet) send: "PRIVMSG test hello, this is a test" receive: "hello," what can i do to fix this problem? secondly, … | |
Hello, I have compiled a GCC plugin successfully, but I get error when linking: [CODE]$ make /opt/imo/bin/g++ -g -fplugin=../libimo/libimo.so -o test main.cpp cc1plus: error: Cannot load plugin ../libimo/libimo.so ../libimo/libimo.so: undefined symbol: _ZN11NodeFactory10CreateNodeEN4BEEV4KindERKNS0_7ASTNodeES4_RKSt6vectorIS2_SaIS2_EE make: *** [default] Error 1 [/CODE] I know that the plugin works fine for other Ubuntu users, so … | |
Struct Day { explicit Day(int d) : val(d) {} int val; }; what does the colon in the 3rd line means? Thanks | |
Please explain me in detail : [CODE]const char *str1 = "pointer to constant"; char *const str2 = "constant pointer"; const char *const str3 = "constant pointer to constant"; str1[0] = 'P'; // illegal! str1 = "ptr to const"; // ok str2 = "const ptr"; // illegal! str2[0] = 'P'; // … | |
Hi all, I'm new to C++ after having worked with c# and java for a number of years. I'm having trouble getting my head around destructors and their proper use. take for example this problem i'm working on at the moment. you have a double linked list centered around a … | |
^^^ Typing fail, should be possibly ^^^ What is the best cross-platform library for high-performance graphics. I have tried SDL and GLUT, but I want to know if there are better ones out there. Also, is there a simple way to access OpenGL without a front-end library? | |
This is a basic calculator I made in C++. I am learning C++ on my own. [CODE] #include <iostream> using namespace std; float Add (float &a,float &b) { float c; c=a+b; return (c); } float Subtract (float &a,float &b) { float c; c=a-b; return (c); } float Divide (float &a,float … | |
[code] class TextBlock { pulic: ... const char& operator[] (std:size_t position) const {return text[position];} char& operator[] (std:size_t position) {return text[position];} private: std::string text; }; [/code] for the member functions why the return type is reference to char char& instead of char? return text[position] is a char for sure,not an address, … | |
Hey guys. I'm making a program for tic tac toe but i'm stuck now. I want to move the section in the while loop from the main function at the very bottom to a new public class called nextMove but I'm not sure how to do that. Also How can … | |
Hi all im new to c++, But im after a code that can make c++ put text in a window that i can copy and paste, any help. if you need more info please ask. Thank you | |
Im trying to solve ACM - 10082 [URL="http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=31&page=show_problem&problem=1023"]http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=31&page=show_problem&problem=1023[/URL] Judge is responding wrong answer...but, i have no idea why. Any suggestion? [CODE] #include<iostream> #include<string> using namespace std; char change(char x); int main() { string str1; getline(cin, str1, '\n'); transform(str1.begin(), str1.end(), str1.begin(), change); cout << str1; return 0; } char change(char x) … | |
Hi Pros! I've started a project called grina ( code name) which is web browser program fro people to view web pages using C++ with Qt based on the QtWebKit module. The fact is that, i know a little about the web browser system, that it acts like a compliers … | |
i have a few questions.: 1)if i wanted to write a line of code needed to declare a 1-dimensional array named names that can hold 8 string values would this be correct?: char names[8]; 2)how would i write the code needed to assign strings to each element of the array … | |
[B]Microsoft Visual C++ 2008[/B] My Project contains one Form1 and one Unit (module) Test1.cpp. There is the button1 on the Form1 which calls the function: [CODE]Test1::Change_Button_Text();[/CODE] There is only one function in unit Test1.cpp [CODE]void Test1::Change_Button_Text() { // #1 Form1::button1->Text = "Hello forum!"; // isn't working :( // #2 Form1 … | |
I have problem with this code,I want to print names of the windows in .txt file and it compile with no errors but it snaps in runtime. this function int x = GetWindowText(hWnd,title, 256); for the second arg require char* and cant deal with WCHAR and if i cast title … | |
Problem Statement: You are required to define a string class name string. The data members of the class are the character array and size of the character array. There should be two constructors one is default and other should be overloaded constructor. Display() is the method which display the string. … | |
This is an assignment for my c++ class im taking. [code] #include <iostream> #include <fstream> using namespace std; const int NAMESIZE = 50, DATE = 25; struct inven { char name[NAMESIZE]; int qnty; double wholeCost; double retailCost; char date[DATE]; }; void displayMenu(); void addRecord(fstream &); void displayRecord(fstream &); void modifyRecord(fstream … | |
While finishing up my app, I included into the project the code for loading and injecting my dll into running processes. Once compiling I received these errors [CODE]error C2039: 'getchar' : is not a member of '`global namespace'' error C2873: 'getchar' : symbol cannot be used in a using-declaration error … | |
Okay, I'm making a shooter game, and all my weapons are differnt userdefined objects; ie. the flamethrower works differently then the gun, however, I'm calling some functions in my "main", an example of this would be; [CODE] /* <Init> */ MachineGunClass *CurrentWeapon; MachineGunClass *MachineGun; MachineGun = new MachineGunClass(); CurrentWeapon = … | |
ANY HELP YOU CAN PROVIDE WILL BE GREAT. Here is the code Im trying to convert. This is my 1st time hearing about SRC Code and my teacher isnt being a big help. Please help in any way you can. Here is the code: int a = -5; int b … |
The End.