49,757 Topics
| |
can you help me fix this code to make it better and more acceptable as per coding standards and such. im trying to get a good grasp of classes in c++ [code=c++] #include <iostream> using namespace std; class Calculator { private: int number1; int number2 ; public: Calculator setCalcNumbers(int input1 … | |
| A win32 listview with the view style set to LV_VIEW_DETAILS will not draw onto a window with its exstyle WS_EX_COMPOSITED set? Why? Heres my code for changing my dialogbox to composite if anyone is interested: [CODE] case WM_INITDIALOG: { unsigned long styles = GetWindowLong(hwndDlg, GWL_EXSTYLE); SetWindowLong(hwndDlg, GWL_EXSTYLE, styles | WS_EX_COMPOSITED); … |
hey guys i just want to ask for your help about the source code of ROCK PAPER SCISSORS game on c++, the rules of the game is that, the user and the computer will battle, the game consist of 5 rounds ONLY,and first player who score 3 out of 5 … | |
I'm getting this error: [CODE]error: no matching function for call to 'cp::cpImageButton::SetMouseClickCallback(TitleScreen* const, void (TitleScreen::*)())'| note: candidates are: void cp::cpImageButton::SetMouseClickCallback(DisplayObjectContainer*, void (DisplayObjectContainer::*)())|[/CODE] However, TitleScreen inherits from DisplayObjectContainer, so I'm unsure why this isn't working. I haven't really worked with inheritance in C++ much, so a push in the right direction … | |
Hi. I am currently building a small DLL (~20 functions so far) project to sit between a larger DLL and a VB project. I am now at a stage where I want some advice before proceeding (I can fairly easily make changes at this stage, but if I continue it … | |
Hi guys.... It has been a long time since i left this forum.. Now i'm actually back studying c++ and here is the little problems that i got with the 2D array question. I need to create this pattern using the 2D array: 1 0 1 0 1 1 0 … | |
I am trying to remove the need to #include stl elements in my header (a requirement for a project I work on). I wrote a "wrapper" for std::vector called "MyVector". I declare a pointer to a MyVector as a member of MyClass. Then when I try to use this in … | |
i'm trying to use string stream to get data from an input file. the program works until it get's to adding the elements to the array. i'm still not completely sure how to make use of stringstream yet or if i'm using it right. [CODE] ifstream ipf; ipf.open(test.txt); char c; … | |
Hi everyone i need some help im trying to compile a visual c++ program but theres a make file how do i us this to compile my program to exe im using windows xp thanks for your help | |
Hey, I have an array of ints that are read from a file then stored in an unsigned char array. The array is declared in a static link. The pointer is then passed to main. Main then calls a DLL which will process the information that is stored in the … | |
Finished writing this a little while ago but unfortunately the generated MD5 doesn't match other application's hashes. I have basically used [URL="http://en.wikipedia.org/wiki/Md5"]Wikipedia[/URL] for reference. I have a feeling my error is introduced in the padding stage but I can't be certain, hoping a fresh set of eyes could point out … | |
Hi, I'm working through a tutorial and I've gotten to this part, creating a basic window: Code: hwnd = CreateWindowEx( WS_EX_CLIENTEDGE, g_szClassName, "The title of my window", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 240, 120, NULL, NULL, hInstance, NULL); A explaination is now given which I don't really understand: " The first parameter … | |
Hello. I have some problems. 1.With for cycle. This is my code: [CODE]#include <iostream> #include <fstream> int main () { int i; int i2; char sentence [200]; char repeat; ofstream file ("file.txt", ios::app); for (i=0; i<1;) { cout << "Enter sentence (max. 200 symbols)\n"; cin >> sentence; if (!file) { … | |
Hi, I currenty working on some assignment. This requires a server to process some entities for specific time. after that time server not process any entities further. I don't get to how to start implemet this. Plz help Thanks in advance. | |
0 down vote favorite I'm trying to figure out how exactly to use stat() to capture information about a file. What I need is to be able to print several fields of information about a file. So.. [CODE] #include <iostream> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> using namespace std; int … | |
Anyone know where is my M+U result go?? [CODE]#include <iostream> using namespace std; template<class P> P add(P a, P b){ P result; result = a + b; return result; } int main() { int a1 = 5, a2 = 3; double b1 = 1.2, b2 = 2.3; char c1 = … | |
Hey guys, I'm getting this error: [quote]1>GoblinRecruit.obj : error LNK2019: unresolved external symbol "public: void __thiscall Mob::set_data(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,int,int,int,int,int,int,int,int,int)" (?set_data@Mob@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@HHHHHHHHH@Z) referenced in function "public: __thiscall GoblinRecruit::GoblinRecruit(void)" (??0GoblinRecruit@@QAE@XZ) [/quote] When I try to run this section of code: [code=c++] #include "Standard Libs.h" #include "Ability.h" class Mob { private: string … | |
Does anyone know how to "disable" the windows taskbar.. or at least "hide" it, using Win32? I've seen it done in another program.. but I was clueless as to how the person did it. I would like to be able to display one of my programs on the entire screen, … | |
hellow need your help there is my code i try to get the text from combobox & put it in request but when i wont to ut the result of the request in other texbox i figure out that the value is empty : [code]HSTMT hStmt; char* nbnk; int ret1; … | |
Okay, this is probably gonna sound dumb, but I need to know if it's possible to take a variable held using C++ and make it an environment variable in a Linux terminal. If it makes a difference, I'm using Ubuntu Linux with the Gnome shell. | |
Hi, i'm making a program that outputs a lot of questions at 1 time. .... ?? .... ?? .... ?? and i want write the answers in front of the questions and input it in the same order... that would be like How are you? and i write the answer … | |
hi all, i need a c++ code to display a non binary tree. it should be used with STL multimap.. please help me to find the same.. | |
Hi everyone.. I've recently switched over from Visual Studio 6.0 to visual Studio 2010.. The problem is studio 2010 does not have an "execute .exe button," as version 6 does. Is there a way to manually place an execute .exe button inside of visual 2010? | |
Design and write a program to calculate the third angle and the other two sides of a triangle. The input to the program is the length of one side a (unit not important) the sizes of the two angles adjacent to that side B, C degrees An important point that … | |
[CODE]void addname(string name) { ofstream myfile(CONTACTS,ios::app ); myfile.open(CONTACTS); if (myfile.is_open()); { myfile<<i++<<name<<endl; myfile.close(); } }[/CODE] Initially the codes just kept on overwriting the existing file, but after that i was told to put ios::app. However, it is still now working....now even worse...ofstream is not even writing the file...hellp.. | |
i have an error on this code i cant open example.txt using my declarations. #include <fstream> #include <iostream> #include <string.h> #include <time.h> #include <string.h> using namespace std; int main() { char time[9]; char date[9]; _strtime(time); _strdate(date); string nop; nop = "example.txt"; ofstream dtfile(""nop"", ios::app); dtfile<<time; dtfile<<" "<<date<<endl; dtfile.close(); } | |
Hello everyone, I don't have much experience with C++ and it has been a while since I have last used it. Right now I am writing my own class for quaternions. My problem which I cannot figure out is what is wrong with the operator overload shown below... No matter … | |
when i tried to compile it, why i got expected primary-expression before input? [CODE]#include "mylibrary.h" #include "contadd.h" //for function declaration void Contact::setname(string name) { ofstream myfile; myfile.open(CONTACTS); if (myfile.is_open()); { myfile<<name<<endl; myfile.close(); } i++; } int main(int argc, char* argv[]) { vector <string> input; Contact addingname; if (argc == 2) … | |
I need to write a program for class. I'm not necessarily looking for code, just help. I need to file input data in this format: 01 - 00:53 - 70 01 - 02:45 - 50 01 - 03:31 - 79 01 - 04:30 - 56 01 - 05:55 - 59 … | |
Hello, everyone I just wrote a program by using vc 2010 and it won't compile. The reason was 1>------ Build started: Project: 17, Configuration: Debug Win32 ------ 1> 17.cpp 1>c:\users\yuan\documents\visual studio 2010\projects\17\17.cpp(101): warning C4244: '=' : conversion from 'double' to 'float', possible loss of data 1>17.obj : error LNK2019: unresolved … |
The End.