49,761 Topics

Member Avatar for
Member Avatar for unbeatable0

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 …

Member Avatar for dougy83
0
555
Member Avatar for kux

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 …

Member Avatar for dougy83
0
110
Member Avatar for kazek

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

Member Avatar for miepmuts
0
175
Member Avatar for zoner7

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 …

Member Avatar for dougy83
0
84
Member Avatar for coveredinflies

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 …

Member Avatar for vijayan121
0
187
Member Avatar for Emerald214

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

Member Avatar for Emerald214
0
152
Member Avatar for mksakeesh
Member Avatar for cat08

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 …

Member Avatar for Nick Evan
0
85
Member Avatar for grisha83

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 …

Member Avatar for vijayan121
0
103
Member Avatar for iamthwee

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 …

Member Avatar for vijayan121
0
90
Member Avatar for kashifbhatti

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 …

0
95
Member Avatar for paolomontero

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.

Member Avatar for marco93
0
135
Member Avatar for nizbit

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 …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for timelapse

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

Member Avatar for VernonDozier
0
1K
Member Avatar for chunalt787

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

Member Avatar for chunalt787
0
110
Member Avatar for kyosuke0

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 …

Member Avatar for kyosuke0
0
160
Member Avatar for PuQimX

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 …

Member Avatar for obj7777
0
110
Member Avatar for GamesSmash

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 …

Member Avatar for GamesSmash
0
168
Member Avatar for coveredinflies

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 …

Member Avatar for William Hemsworth
0
158
Member Avatar for coolcampers

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.

Member Avatar for Narue
0
2K
Member Avatar for Raija

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

Member Avatar for Narue
0
105
Member Avatar for Azurea

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

Member Avatar for Salem
0
93
Member Avatar for DJPlayer

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

Member Avatar for Cepolation
0
157
Member Avatar for xr0krx

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 …

Member Avatar for Narue
0
114
Member Avatar for daesdaemar

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 …

Member Avatar for Sky Diploma
0
2K
Member Avatar for policeachan

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?

Member Avatar for Narue
0
168
Member Avatar for khushal_kkk

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 …

Member Avatar for jencas
0
135
Member Avatar for Dinomike1000

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 …

Member Avatar for jencas
0
1K
Member Avatar for AutoC

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?

Member Avatar for AutoC
0
277
Member Avatar for princess_19

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

Member Avatar for ithelp
0
96

The End.