- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 25
- Posts with Upvotes
- 24
- Upvoting Members
- 17
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Re:
Hello, I am using a singleton pattern, which works fine. But when I decided to have a singleton of a nested class that is privately declared. [CODE]class A : public CSingletonTmpl<A> { class B : public CSingletonTmpl<B> { }; }; A* CSingletonTmpl<A>::s_Singleton = NULL; A::B* CSingletonTmpl<A::B>::s_Singleton = NULL; [/CODE] The … |
|
Re:
Hi , I m doing my project in vc++.. I need to interact my vc++ project with NI MAX software.. I m taking Frame API for ineracting to UPS . I included "nican.h" header file for that. I didnt missed any brackets... but while executing i m getting error like … |
|
Re:
can i change the value of an int with a pointer. e.q. int n = 20; int *size = n; can i change n by doing this *size++. thanx |
|
Re:
I have a void type array. I want to create a function which will read 12 bits in each time and store it in a unsigned int type variable. Any ideas? Thank you. |
|
Re:
Here is the code: [CODE] if(i&~077)[/CODE] , where i is an int value. The condition is supposed to be testing whether i is within a proper range. But how? Thank you very much! |
|
Re:
[CODE]class C_Class { public: struct _Get { void foo( void ) { m_Var = 0; } }Get; struct _Set { }Set; long m_Var; };[/CODE] I like to organize my functions with get and set structures [CODE] Get.ThisThing(); Set.ThisThing();[/CODE] But my structure's functions cant access the classes members unless I make … |
|
Re:
Hi, I'm new to C++. I'm having trouble detecting space bar as an input. I'm unfamiliar with using the char data type. I've tried using ASCII decimal numbers but only detects the '.' . And I'm unsure how to go about this without using string or anything advanced. [CODE] char … |
|
Re:
Hello, i got a problem with identifieng my classes upon its static ID number. Upon creation of each class, it recieves its individual number, the numbers are ascending from 0 to "endless". So now, I want to do a loop like this [code=c++] for(int i = 0; i <= Class::GetMaxIDNumber(); … |
|
Re:
Hello for my C++ programming class I am programming a Dictionary program that allows the user to enter in definitions and stores them between 2 classes. Dictionary which will contain all my entries and Entry which will contain the definition for every word that the user inputs. Now when they … |
|
Re:
I am working at a project that is supposed to run a python script. Here is my main class: [CODE] #include <iostream> #include "scripting.hpp" int main(void) { cScripter oScripter; std::vector <double> vectMy (7, 32); oScripter.doRunScript (&vectMy, "test.py", "function"); return 0; } [/CODE] And here are respectively scripter.hpp and scripter.cpp : … |
|
Re:
Ok so I am a total newbie, and for our last programing assignment in my class we are going over Binary Search Trees. Out assignment is to take an older program and make it into a binary search tree. I am using Visual Studio and I have gotten past all … |
|
Re:
Hi there, ive been comin here for about a month glancing at forum posts and the practice thread.. I have been self teaching myself C++ for a few months, and it was pretty challenging at first, my biggest problem is memorization.. so anyways... i was wondering if anyone could help … |
|
Re:
[CODE] void open_key(HKEY* Key , HKEY key , LPCTSTR subkey) { cout << Key[1] << endl; RegOpenKeyEx(Key[1] , subkey , 0 , KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE , &key); } int main() { HKEY keys[] = {HKEY_CLASSES_ROOT , HKEY_CURRENT_USER , HKEY_LOCAL_MACHINE , HKEY_USERS , HKEY_CURRENT_CONFIG}; open_key(&keys[1] , hkey , "Software"); } [/CODE] … |
|
Re:
Is there a data structure that lets me push and pop things onto/off of a queue, but also doesn't allow duplicates? E.g. I want [code] queue a; a.push(1); a.push(2); a.push(2); a.push(3); [/code] to only have 3 elements, because 2 was added twice so the second time it is just ignored. … |
|
Re:
Volunteer C++ Gurus. Thank you in advance for your time. This site has saved my sanity. I am working with my longWords function and cannot get it to stop displaying the same value (2293264). I know that my code is a little janky because I modified it from array format … |
|
Re:
Write a C++ program that reads a series of 12 temperatures (floating-point numbers) from an input file. It should prompt the user for the name of the input file. The input file should be place in the same directory where your source program resides. It should write out on the … |
|
Re:
hi,,, i have converted the image in to gray and created itz histogram...nw i m applying various filters on the gray image...my problem is: 1.. want to display the result image after filtering in dialog box... for this i have created the dialog class...but not getting how to send the … |
|
Re:
Hi there, i'm trying to make a program which translates a word from one language to another, using files (one file for each language) i'm using fgets, to read a line from the file and then comparing it to what the user entered, and strcomp() to see if the words … |
|
Re:
Hi I've just started out in c++, can anyone tell me how to use pointers which hold addresses of objects ? How do you access the object fields from this type of pointer, especially strings (array of chars)... I'm using a Dev c++ 4.9.9.2 compiler.... |
|
Re:
I wrote this distructor one way, but the person who code reviewed it seems to think it's better and more readable the other way. I disagree. It's probably more a matter of preference, but what do you think... [code] RfPrinter::~RfPrinter() { if (!hub_.empty() && !name_.empty()) { clearbuf(rfunitlock); rul_hub = hub_; … |
|
Re:
For example, [CODE]MyClass *stable; if(..){ MyClass temp; stable=&temp; } stable.myVariable;[/CODE] Code snippet above does not work, because destructor of temp object is called. How Can I Increase Scope of "temp" object? Thanks. |
|
Re:
Hi, I've spent a lot of time on this program and I'm stuck. My assignment is to prompt for two input strings. Print out each string Concatenate string1 and string2 and store the concatenated string into string3 without changing what's stored in string1 or string2. print out the concatenated string. … |
|
Re:
I am using VC++ 2008. I want to rotate the Bitmap in my MFC application. I tried the GetPixel and SetPixel functions, but the performance is too slow. There seems no Bitmap rotation example using MFC class on the internet Can anyone give me some idea? Sample code will be … |
|
Re:
Hey guys, ive been working on this code for the past couple of hours and I am trying to do the following problem. Write a program that reads the le generated by randGen.cpp (in Problem 1) and stores the numbers in an array of type int. You can assume that … |
|
Re:
I am getting the following error while building the code in VC: error C2143: syntax error : missing ')' before '&' on building the below code: [CODE]typedef unsigned int uint4; void Find(uint4& a, uint4 b, uint4 c); void Find(uint4& a, uint4 b, uint4 c) { . . . . }[/CODE] … |
|
Re:
This is likely a stupid question, but I can't figured out by myself how to pass a pointer to a member function of a templatised class in its own template parameters. More clearly: I would like to have this to work out: [code]template <typename T, T test::* PtrToMember> class test{ … |
|
Re:
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; i am having trouble putting functions in int main(). can someone show me how??? i want to put these function def. in int main() [CODE]int score_num(int& ns1,int& ns2,int& ns3, int& ns4, int& ns5, int& n6, char& gam_answ); int roll_hold(int roll, int … |
|
Re:
I want to fill a structure and then print it. How to print the values of the structue? The structure is: [CODE] #define UINT32 unsigned int #define INT32 int #define UCHAR unsigned char typedef struct CheckSumPair { UINT32 weakcs; // The weak, rolling Adler32 checksum. UCHAR StrongCS[10]; };[/CODE] I have … |
|
Re:
i got errors and i cant find out what they meant i have went down the program line by line trying to figure them out and i am having no success. I am trying to use call by call values and parametrers n this program. (list of errors are below) … |
|
Re:
error: default argument for `int&ns1' has type `int'. i cant figure out why this error is popping up it says the error is on line 3, anyone know how to help? [CODE]#include<iostream> using namespace std; void score_num(int &ns1=0,int &ns2=2,int &ns3=3, int &ns4=4, int &ns5=5, int &n6=6, char gam_answ); void display_score(int … |