No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
19 Posted Topics
[CODE]//--------------------------------------------------------------------------- #include <windows.h> #include <CommCtrl.h> // needed for adding custom toolbar #include "resource.h" #pragma hdrstop //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- LPCTSTR ClsName = L"FundApp"; //LPCTSTR WndName = L"Resources Fundamentals"; const int NUMBUTTONS = 3; TCHAR AppCaption[40]; LRESULT CALLBACK WndProcedure(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); //--------------------------------------------------------------------------- INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, … | |
How do i alter an element in the set for example how do i edit the 'm_a' member variable of a element in my set? class CPerson { public: int m_a; CPerson(int _a) { m_a = _a; } } set<CPerson*> myPersonSet; .. ... set<CPerson*>::iterator it = myPersonSet.find( CPerson(20) ); // … | |
can anyone please provide me with a clear explanation of Win32 resources? You can make a dialogbox or menu for your win32 program using either resources or using c++ to code it. 1.) Why would i ever choose to use a resource script/editor provided by my compiler vs codeing it … | |
Working on an assignment for class. I was able to get the sorts created buy for some reason im having a problem with reducing redundant code within my int main() function [code] /* 1.) create 10, 100, 1000, and 10000 randomly generated elements 2.) Perform The Following Sorts on the … | |
can anyone explain the purpose of a tracking reference vs native reference in c++/CLI? | |
[CODE]struct ch8_struct { int field1; short field2; char field3; int field4; double field5; }; struct ch8_struct g_StructArray[3]; ch8_struct *g_pStructArray = g_StructArray; ch8_struct **g_ppStructArray = &g_pStructArray; g_ppStructArray[1]->field1 = 11;[/CODE] program is crashing on g_ppStructArray[1]->field1 = 11; i think my pointer notation is wrong :) | |
[code]int Add(int nX, int nY) { return nX + nY; } int main() { int (*pFcn)(int, int) = Add; int (*pFcn)(int, int) = &Add; cout << pFcn(5, 3) << endl; // add 5 + 3 return 0; } [/code] my question is are both of these lines equivalent? or is … | |
[url]www.learncpp.com/cpp-tutorial/103-aggregation[/url] In the example given they state a department can have a teacher and if a department goes out of scope/deconstructs it doesnt destroy the teacher that was in that department. for example in real life departments at different school change names,get added,and get deleted all the time. Just because … | |
[CODE]class Cents { private: int m_nCents; public: Cents(int nCents=0) { m_nCents = nCents; } // Copy constructor Cents(const Cents &cSource) { m_nCents = cSource.m_nCents; } };[/CODE] will the copy constuctor still work properly if i had decided to implement it was follows [CODE]class Cents { private: int m_nCents; public: Cents(int … | |
Because references always “point” to valid objects, and can never be pointed to deallocated memory, references are safer to use than pointers. Can anyone give an example of this? this doesnt make sense. couldn't you just do [CODE]int& function() { int variable = 3; return variable&; }[/CODE] looks deallocated to … | |
The following was produced by my decompiler of some disassembly DWORD v4 = *(_DWORD *)(*((_DWORD *)&dword_8EF798 + a2) + 1020); i dont understand how the & changes the above pointer dereferencing. Can you explain the different in interpretation of *(_DWORD *)(*((_DWORD *)&dword_8EF798 + a2) + 1020); vs. *(_DWORD *)(*((_DWORD *)dword_8EF798 … | |
typedef struct _FOO { int blah; int blah2; int blah3 } FOO, *FOO; 1.) Does this create 2 objects of type FOO and another that is a pointer to a FOO? 2.) OR does it just typedef the names so you don't have to do the following struct __FOO fooStruct; … | |
Is there ANY EVER reason why i would return an object or variable by reference? to me this doesn't make sense and is very bad. | |
i have a question where i should place #includes in a file? Here is what i tend to have example.h #include <iostream> #include <string> example.cpp #include <iostream> #include "example.h" ------------------------------------------------ Is This what i want? example.h #include <iostream> #include <string> example.cpp #include "example.h" What should i strive to achieve? 1.) … | |
I am quite confused on the following terms...are all the following terms all the same way to pretty much say "nonmember function" ( function that works with a class that isnt apart of its public interface ) [B]auxillary function helper function free function utility function[/B] | |
i am injecting a dll into oneo my process's and i want it to read the bytes of the file and write those specified bytes to a file on hard disk. The problem is my .dll compiles, but when the .dll isi njected, it never creates the file and writes … | |
when you make a .cpp file with just functions and call it your library, is it still proper to provide a .h file with it that has the functions prototypes in it? | |
im wanting to make a class called Log. with the template as follows class Log { private: std::ofstream outputFile; SYSTEMTIME systemTimeBuffer; public: Log( std::wstring error1 ); Log( std::wstring error1, std::wstring error2 ); Log( std::wstring error1, std::wstring error2, std::wstring error3 ); Log( std::wstring error1, std::wstring error2, std::wstring error3,....... ); ......... ........ … |
The End.