49,761 Topics
| |
hey everyone im making an gui in C++ which needs to retrieve windows registrys such as windows version etc. however im stuck on some code i was hoping for some help please. [CODE] void GetSystemInformation(void) { float fprocessor; HKEY hKey; DWORD processorspeed; DWORD datasize; RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Hardware\\Description\\System\\CentralProcessor\\0",0, KEY_QUERY_VALUE,&hKey); RegQueryValueEx(hKey,("~MHz"),NULL,NULL,(LPBYTE)&processorspeed,&datasize); fprocessor=float(processorspeed); if (fprocessor>1000) … | |
ok so i got my code done but my logic in my code is off and my outputs are not coming out the way they should. so the following is a notepad file which is being read into my program 1231 washington, george 300 3431 adams, john 600 5767 jefferson, … | |
Privet/hello/salut/halo/hola! I have the following code: [code=c] #include <iostream> #include <iomanip> #include <fstream> #include <cstdlib> using namespace std; using namespace Finder; int main() { ifstream in( "1.dat" ); Event *P = new Event( sphere ); double px, py, pz; while( in>>px>>py>>pz ) { P->AddParticleRaw( px, py, pz ); } in.close(); … | |
Hello All, I was trying to make dll to play with ctypes in python. I'm not good at C++ and I studied it lightly looong ago and only familiar with very simple thing. After search the net I found smo instructions but when I try to Build (with CodeBlocks), I … | |
hi guys just a query basically I have created the following program, which takes a word then shows the position of a certain character. Now what I need to do is then print out each characters position in the array: so for example T E S T 0 1 2 … | |
the program that im having problems reads in a txt file sums both arrays of data, puts the sums into some equations and out puts the results in a txt file. [CODE]#include <iostream> // include all headers needed here #include <cmath> #include <cstring> #include <cctype> #include <fstream> #include <cstdlib> using … | |
I have a program in were you enter numbers. each different # set you enter goes into an array ( section[] ) but now what I'm trying to do is add 2 different sections together. [code]for(int x = 0; x < stoppoint; ++x) { track = track + 1; if(section[x] … | |
Hi everyone, I have worked some more on my code and this time I am getting some error that I am not able to resolve. Please help me. The error says: "initialization skipped by case label." Please show me how to resolve this. Here is the code. The error has … | |
Ok, I never really understood vectors and I have write a program that uses a vector of Employee references to store the company’s payroll. My program will load the payroll by reading a file (employee.dat) that contains one employee’s information per line. Each line of the file will begin with … | |
I hsve developed this code I am having trouble with the Account manager to perform the task it meant to do when i put N for New customer it exits the program and i shouldnt can anyone hepl me with this problem [code] #include <iostream> #include <string> #include <cmath> #include … | |
hi people, i am able to make the following code work if i don't use a destructor: #include<iostream> using namespace std; class CVector{ public: int *x, *y; CVector(); CVector operator+ (CVector); CVector(int,int); // ~CVector(); private: }; CVector::CVector(){ x = new int; y = new int; *x=0; *y=0; } CVector::CVector(int a, … | |
Some of the code has been omitted. I am trying to write a DFS function to traverse a maze. It will eventualy add the nodes to a tree that I will traverse once I get the DFS working. Currently it goes into an infinite loop and I cannot figure out … | |
Hey again guys and gals, getting a really weird error when i attempt to print out doubles in my program i have to store several double values, but when ever i print then out all i get is -9.25596e+061 instead of what should be printed out. [code=C++] string line; stringstream … | |
I'm still fairly new to C++ and templates and I had a question revolving them. I'm currently doing a tutorial on templates and wanted to mess around with the code. This is what I have so far: [code=c++] //mypair.h template <class T> class mypair { T values [2]; public: mypair … | |
Hello, I implemented the follolwing function: [code] template< int n > struct GetNRands{ static void fillVector( set<int>& v, int max ){ if( n > 0 ){ int f; int pos; do{ f = rand(); pos = f * max / RAND_MAX; } while( v.find( f ) != v.end()); v.insert( pos … | |
win2000 , visual studio 2005, console application (sorry my poor english) I dont know very well how start explain whats my problem.. Im making a sudoku game (not unic solution, just random =P) the problem is the loop where it suppose to verify the sudoku rules and make the corrections … | |
Hi All, I'm trying to figure out how to pass an object to a function by constant reference. If I write a single class, can I write a function in this class that accepts an object of this class by constant reference? If so (or in any case) how does … | |
Hi , I am working with MFC SDI application, when i open any project [ SDI ] default icon gets loaded [ ie MFC icon ] , i am not able to change it , even i tried modifying the icon file, only the ABOUTDialog box icon changes, at all … | |
i have an array of 16 things, now 8 of them have to be chosen at random so basically what i want to do is random(CHR/2) like choose a random number from CHR/2 (as there are 8 not 16 now) what code would i use because that doestn work | |
[COLOR="Red"][B]Hi all... I tried to maked Stack with Dynamic Array but ........[/B][/COLOR] [ICODE]class Stack { private: int *SS; int size; int t; void Expand(); public: //constractors Stack(); ~Stack(); Stack(const Stack & Original); //operations Stack &operator= (const Stack& RHS); bool Empty(); void Display(); int Pop(); void Push(int Value); int Top (); … | |
Hello guys! Hope everyone's doing good. Well I desperately need the code for insertion in 2-3 trees, can anyone of you kindly help me out??? Actually I missed one of the lectures given in this regard, therefore i'm facing few daft problems, I tried to some extent but couldn't make … | |
Dear All, I have to remove some content of a file, but I can't find any api to use. Best regards! | |
Why does following does not work ?? [CODE] #include<iostream> using namespace std; class point{ float x,y,z; public: point(float f_x =1.0, float f_y=1.0, float f_z=1.0); void getxyz(float &x, float &y, float &z); }; point::point(float f_x, float f_y, float f_z) { x= f_x; y= f_y; z= f_z; } void point::getxyz(float &x, float … | |
well the title kinda describes it. I tried LOWORD(lParam) = somenum; and it threw me an error saying that the left side valye has to be a 1-value | |
I have problem in counting the number of letters in the strings entered by the user. CAn anyone suggest something in the following codes? [code=cplusplus] #include <iostream> using namespace std; int main() { char* str; cout<<"enter the string to count the number of letters in it."; cin>>str; cout<<str.length; return 0; … | |
How can i get the digits out from file and the player who scored the most points? Input file to read from Match A score: 3-1 [U]Mark Peter Peter[/U] Match B score: 1-1 [U]Jim[/U] underlined - player who scored the points [code=cpp] #include <iostream> #include <fstream> #include <string> using namespace … | |
I dont know why, but this program I wrote is having a problem. it has a problem converting an Ace from 11 to 1 when the players have more than 21. if you could look over this, I would appreciate it. [code] #include <iostream> #include <ctime> using namespace std; double … | |
I am stuck in a problem where I should show a progress in % in a label. I have manage this code and think this should work but the label doesn´t update the % value it only shows "Progress... 0 %". Is there anything I perheps should add to update … | |
With printf, you specify the output type like this unsigned char a; printf("%u", a); but with cout, cout << a; there is no type required. Do you have to cast the variable in order to see a reasonable output cout << (int)a; or something like that? How do you know … | |
Does anyone know how to search a text file for just alphanumeric words using regex? And could you show me? |
The End.