49,757 Topics

Member Avatar for
Member Avatar for daggerdvm

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 …

Member Avatar for embooglement
0
149
Member Avatar for stevee1984

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); …

Member Avatar for stevee1984
0
303
Member Avatar for darkmeyi0319

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 …

Member Avatar for dflatt
-2
159
Member Avatar for michdd

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 …

Member Avatar for mike_2000_17
0
147
Member Avatar for ftl25

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 …

Member Avatar for mike_2000_17
0
115
Member Avatar for samsons17

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 …

Member Avatar for Fbody
0
129
Member Avatar for daviddoria

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 …

Member Avatar for daviddoria
0
259
Member Avatar for dflatt

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; …

Member Avatar for dflatt
0
142
Member Avatar for andrewjrmill

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

Member Avatar for helioptra
0
117
Member Avatar for indigo.8

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 …

Member Avatar for indigo.8
0
5K
Member Avatar for Auraomega

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 …

Member Avatar for Kieran Y5
0
243
Member Avatar for y2kshane

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 …

0
59
Member Avatar for fire_

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) { …

Member Avatar for Kanoisa
0
162
Member Avatar for Rocky111

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
44
Member Avatar for dansnyderECE

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 …

Member Avatar for dansnyderECE
0
453
Member Avatar for HumanBeing86

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 = …

Member Avatar for Fbody
0
197
Member Avatar for Duki

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 …

Member Avatar for Duki
0
97
Member Avatar for PixelExchange

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, …

Member Avatar for PixelExchange
0
430
Member Avatar for sana_moi

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; …

Member Avatar for sana_moi
0
98
Member Avatar for 333kyle333

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.

Member Avatar for 333kyle333
0
303
Member Avatar for ^Y^ nobody ^Y^

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 …

Member Avatar for Kanoisa
0
159
Member Avatar for vidyaj

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..

0
21
Member Avatar for PixelExchange

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?

Member Avatar for PixelExchange
0
108
Member Avatar for kemooo

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 …

Member Avatar for mrnutty
0
119
Member Avatar for Bigbrain99

[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..

Member Avatar for Bigbrain99
0
114
Member Avatar for camcam08

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(); }

Member Avatar for mrnutty
0
79
Member Avatar for come_again

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 …

Member Avatar for StuXYZ
0
169
Member Avatar for Bigbrain99

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) …

Member Avatar for Bigbrain99
0
331
Member Avatar for enkidu75

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 …

Member Avatar for mrnutty
0
113
Member Avatar for gaishi

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 …

Member Avatar for NicAx64
0
191

The End.