- 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: [QUOTE=sjcomp;1148820]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: [QUOTE=shrutinr;1186620]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: No. This will increment the pointer first and then deference the result. You would require paretheses here to achieve the result you want. [CODE](*size)++[/CODE] This is because unary unary operators like ++ associate right to left.. Also you have a problem in that the expression [CODE]int *size = n; [/CODE] … | |
Re: [QUOTE=blackmagic01021;1198621]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.[/QUOTE] So you wish to extract the first 12 bits from each element in your void array? How, … | |
Re: ~077 is the unary of the octal value 77; octal 77 will correspond to the low order 6 bits being set of a word. In 32 bit hex word 0x0000003f. the unary of this flips all the set bits to 0 and all 0 bits to 1 giving 0xffffffc0 this … | |
Re: I'm missing something here. Can you post a compilable example? | |
Re: >> will read to the next whitespace. ie. space character so it wont pick up your space. Do you have to use space? You can explicitly read the next char from the stream though. Check out the other stream functions available to you. Is there anything else you could use. | |
Re: I'm not sure I fully understand your question here. Could we see some code. Just pare down some example classes to the bare minimum required to illustrate what your question is asking and post them. | |
Re: Dictionaries are generally represented by a form of Map as mentioned in previous posts. your solution will wind up with you having many thousands of distinct objects, one for each word entered. this seems to me to be a bit messy. Try reading up on Maps before moving on... | |
Re: why is your definition of vectPointer in your header file? | |
Re: This will likely be a duff pointer. Check your pointers... | |
Re: add the scores together and divide by three. Or if you have n values to average add em together and divide by n. | |
Re: Is that what HKEY_CURRENT_USER is defined to? I'm not going to check for you but I suspec that it is. You would need to provide some method of producing a textual representation of this defined value and printing that instead of the value itself. | |
Re: [QUOTE=daviddoria;1183663] [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. [/QUOTE] But you want this to have FIFO behaviour? Why not create your own queue class, based on a deque for instance, which … | |
Re: I doubt that this will even compile as it stands. You have no return from your longWords function. As for converting a function from an array to a pointer it should not make too much of a difference. When you pass an array argument as a pointer you are passing … | |
Re: or if you wish to read the data items one at a time [CODE] ifstream openFile( "Data.txt" ); float temp; while( openFile >> temp ) { ... }[/CODE] When you write [CODE]openFile >> temp[/CODE] the return value of the input statement is the class object from which you are reading … | |
Re: [QUOTE=shilpa.joshiv@g;1182773]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: Traditionally a dictionary would be represented as a Map. Where the word would act as the key value into the map and the definition would correspond to the value for that key. Maybe you could produce a map for language conversion where the key value is a word in the … | |
Re: [QUOTE=deanus;1181033]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....[/QUOTE] you might want to post … | |
Re: SESE (single entry single exit) was quite a big thing at one point, more especially in C as it was felt that it made functions easier to maintain amongst other things. In C++ where you have exceptions as another way in which a function can be exited it is difficult … | |
Re: Depends how much you want to increase it by. Simply declare it in a lerger scope. instead of [CODE]MyClass *stable; if(..){ MyClass temp; stable=&temp; } stable.myVariable;[/CODE] try [CODE]MyClass *stable; MyClass temp; if(..){ stable=&temp; } stable.myVariable;[/CODE] if you really don't want temp hanging around any longer that necessary then enclise it … | |
Re: [QUOTE=myluvstefan;1177841]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: [QUOTE=LemonLemon;1180716]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: you need to declare stream objects of type ifstream. eg. [CODE] ifstream inputfile; inputfile.open(filename);[/CODE] ifstream is a class definition, not a concrete object which you can use. You have to declare an instance of the class to use it. Looking again I see you have done so in you main. … | |
Re: If your code is as posted then the only problem I can see is the extra ',' in you function prototype. [CODE]void Find(uint4& a, uint4 b, uint4 c[B][I],[/I][/B]);[/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: template <typename T, T test::* … | |
Re: As I have told you in one of your numerous other posts on this subject you need to get hold of an introductory programming text and read the first couple of chapters. You are lacking in some really fundamental concepts here, how to declare and use variables, how to declare … | |
Re: [QUOTE=rkp728;1175860]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: Same problem with default arguments as your other post. | |
Re: Default arguments should be at the right of the declaration. eg. [CODE]int func( int x, int y = 1, int z = 2 );[/CODE] you cannot have variables which do not have a default definition on the right hand side of those that do. [CODE]int func( int x = 1, … |