49,761 Topics
| |
Hey there, I'm trying to use the SetSuspendState() function to hibernate the computer, but I have no idea what parameters I should send to it. The prototype is "BOOLEAN WINAPI SetSuspendState(BOOLEAN, BOOLEAN, BOOLEAN);" Since I'm a somewhat beginner in c++ programming, I don't really have an idea what BOOLEAN means … | |
This may sound silly. I have a class that contains a vector of pointers to instantiated objects. I want to return a refrence to that vector, but I don't want to be able to modify the vector through that refrence. Now, if i return a const reference, the vector is … | |
I've been struggling with this program for few several days now.. It's an implementation of Data structures. I'm trying to use Linked Lists, Sorting and Searching concepts. [CODE=cplusplus]#include<iostream> #include <iomanip> #include <fstream> #include <cstdlib> using namespace std; class videoShopSystem{ public: bool empty() const; void displayMainMenu(); void menuChoice(int key); void addNewRecord(); … | |
So I am using Dev C++ to compile this program; however, whenever I attempt to compile, I recieve a linker error that states, "[Linker error] undefined reference to '_cpu_features_init' ld returned 1 exit status" I googled the question, and people suggested that it may have something to do with the … | |
Hello, my understanding is 'this' is a pointer to the current class you are working in. Is this right? For example in my textbook it has [code] class ThreeD { int x,y,z; public: ThreeD() {x=y=z=0;} ThreeD(int i, int j, int k) {x=i; this ->y =j; z=k;} ThreeD operator+(ThreeD op2); ThreeD … | |
Excuse me, could someone help me? This code from an ebook and it isn’t wrong but it gives an error while being compiled. I don’t understand what error it is. error C2653: 'vector<int,class std::allocator<int> >' : is not a class or namespace name [code] #include<vector> using std::vector; int main() { … | |
Please give me the code as well as the algorithm for the following 3 questions, 1) To generate the following pattern using 'for' loop. 1 2 3 4 1 2 3 1 2 1 1 2 1 2 3 1 2 3 4 2)Write a program to take N array … | |
Hello, I am trying to solve an assignment in a book. It is asking me to write a program that takes a positive number with fractional part, which would round it to two decimal places. For example, 3.4256 to 3.43. Now, the thing that confuses me is that this past … | |
| OK I was wondering what is the easiest way to do this? Let's say I have some arguments int main(int argc, char* argv[]) and argv[1] equals a c-style string. I want to change this to a std::string because I want to do stuff with it and I prefer working with … |
Hi all, I want to created an MDI application in Managed C++.NET, which can use OpenGL. I have created an application VC++, which uses OnDraw function of CView class to render OpenGL drawings. But i am unable to find an alternate of CView class (actually some function like OnDraw which … | |
Hello, Does anyone know which GDI API is called to draw menus and menu items on windows? I know its not DrawText, DrawTextEx, TextOut or ExtTextOut. | |
I'm trying to call a member function inside a class but am having no luck. I need to find the length of the array. When I posted this code before there were some questions on the member functions. The reason those functions are private is that I don't want the … | |
I'm trying to create a program that will deal a random card, and I am VERY confused about how to go about making it. I understand arrays/strings in general but I have no idea where to start. My professor states that we will use the function rand() which returns pseudo- … | |
Hey does anyone have a basic binary multiplication function and or algorithm? I just need to record run times on it for varying amounts of input and don't want to have to spend an hour doing a solved problem for 5 points on a HW. Thanks in advance | |
My goal is to read Olympic data into an array of structs. What i need to read in is the country code, and number of gold, silver or bronze medals that the country won. Also if one country won more than one medal, i am to just increment the information … | |
I don't know to Write a full program that can display the following output: 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 1 2 … | |
Hi, I downloaded the 7-zip SDK from [url]http://www.7-zip.org/sdk.html[/url] I was wondering how to make it so my program could compress a folder using 7-zip. This is confusing for me because it is the first (maybe second) time I am using an SDK and it is hard to find instructions on … | |
Hi! I know alot of people try and learn C++ by themselves,and I am just interested to know how many people here have managed to become [B]good[/B] by learning themselves. Also would be interesting to know the general perception of self-taught programmers by profesionals is? Just for the record I … | |
Hi, I'm an input XML which I try to parse using C++. The problem is ^M characters get inserted at the end of each line and the parser errors out when it encounters ^M character. Can any one tell me how to replace ^M characters in c++ code? Thanks. | |
Hi dudes! And thanks for reading this. So I want rand() to generate random number and again, but the second number can´t be same as the first one. So far my code is: [CODE] int kortti1, kortti2; srand ( time(NULL) ); kortti1 = rand() % 5 + 1; kortti2 = … | |
"They also don't allow goto. The problem with the three of them is that they disrupt the flow of the code for someone reading it. You are supposed to put everything into the conditions for the loop. It seems to me that there are times when a few continues or … | |
well I'm just stating this one and my brain is about racked w/ the # of assignments going on.. anyways. I have to write a program where a user will input a integer and it will determine the kaprekar #'s of that #, until it reaches the user # input. … | |
Hello there, I need some help on how I could replace the getch() function. Basically, my assignment was to make a simple simulated "joystick" program. You press the letters a,b,c,d... and it will output the number pressed... The program works and everything, but i found out im not allowed to … | |
I am trying to write a simple slot machine program that will return three numbers as the slot icons using a loop. I can get the first part just fine (I think). But I am stuck at converting my icons to intergers or character that I can compare to see … | |
it is known that dennis rithie made c with only 32 keywords and writing functions is the responsibility of the programmer. who wrote the functions printf, scanf . what is it's sourcr code? | |
the code that i have coded is of operator overloading for incrementing and the i need some help in the operator overloading for decrementing ,mutiplication and division please send the following in a code form shall be thankful.. [CODE] #include<iostream> class Weight { private: int kg,grms; void ConvertWeight() { if(grms … | |
Hello, I'm trying to create a window with a C++ win32 app project. I am using creating the HWND object, setting its properties, and then registering the object. Also, there is a WindowProc function. What seems to happen is that the object registers but when I call CreateWindowA(...), this function … | |
Hi, I've coded huffman coding.I've formed my codebook.Its correct upto that point.I'm using unsigned int(32 bits) and packing the codes into it and writing to file whenever 32 bits get filled.Somehow..my resultant file is larger than my source file.Am i doing something wrong? | |
Sorry 4 bothering you guys... its that im a beginner at this... they gave me a problem but I dont know how to interpret it, it says as follows: [i]The Babylonian algorithm to compute the square root of a number n is as follows. (1) Make a guess, say g, … |
The End.