49,766 Topics

Member Avatar for
Member Avatar for Fouly

Hi all, I used a function called GetRandomVariable to return a double data type and here's its code: [code]double GetRandomNumber(void) { // Zi = (AZi-1 + C)(mod m) // Zi = (5Zi-1 + 3)(mod 16) RandomVariableGenerator::Znode = (double)((5.0*RandomVariableGenerator::Znode + 3) % 16); return RandomVariableGenerator::Znode/16; } static double Znode = 7.0; …

Member Avatar for Fouly
0
158
Member Avatar for AutoC
Member Avatar for AutoC
0
4K
Member Avatar for 666kennedy

i have an array weights[16][60] this being 16 rows of 60 elements in each one i have another error[16] which co incides with each with the 16 rows, this is the error from each row. is there a way i can put each of the 16 in order in the …

Member Avatar for 666kennedy
0
187
Member Avatar for bids

[code] #include <conio.h> #include <graphics.h> #include <math.h> #include <stdlib.h> #include <dos.h> void serp(int level, int Ax, int Ay, int Bx, int By) { int poly[4]={Ax,Ay,Bx,By}; setfillstyle(SOLID_FILL,YELLOW); if (level>0) { serp(level-1, Ax,Ay ,(2*Ax+Bx)/3,(2*Ay+By)/3); serp(level-1,(2*Ax+Bx)/3,(2*Ay+By)/3,(Ax+Bx)/2+sqrt(3)*(Ay-By)/6,(Ay+By)/2+sqrt(3)*(Bx-Ax)/6); serp(level-1,(Ax+Bx)/2+sqrt(3)*(Ay-By)/6,(Ay+By)/2+sqrt(3)*(Bx-Ax)/6,(Ax+2*Bx)/3,(Ay+2*By)/3); serp(level-1,(Ax+2*Bx)/3,(Ay+2*By)/3,Bx,By); } else fillpoly(2,poly); } int main(void) { int graphdriver=DETECT, graphmode; initgraph(&graphdriver, &graphmode, ""); int i, …

Member Avatar for bids
0
143
Member Avatar for emotionalone

I need to create a Space Invaders kind of game and I have a demo I need to copy the main features from. The invaders have to be of at least 3 different types and they change color. So I figured the invaders are 3 child classes from a parent …

Member Avatar for cikara21
0
227
Member Avatar for Alex Edwards

In C++, where are the header files that define the standard primitives and bitfields? I would like to confirm something, if it is possible. -Alex

Member Avatar for ArkM
0
186
Member Avatar for MylesDBaker

Hello, I am trying to declare a 2D array (3x3) inside of a class. I have it set up like this: GameBoard.cpp[CODE] #include "GameBoard.h" #include <iostream> using namespace std; char board [3][3]; GameBoard::GameBoard() { board [0][0] = 'a'; board [0][1] = 'b'; board [0][2] = 'c'; board [1][0] = 'd'; …

Member Avatar for ArkM
0
150
Member Avatar for CoolGamer48

Does anyone actually use the .hpp file extension for C++ header files? I've never seen it used, but I was just working with geany, and I noticed that it only syntax highlights C++ specific things if the file extension is .hpp (or .cpp, obviously, but not .h). So what's the …

Member Avatar for ArkM
0
138
Member Avatar for vahny

[code] #include<iostream.h> int main() { int row1[10]; int col2[10]; int m,n,p,q; cout<<"Enter the number of rows in matrix A"<<endl; cin>>m; cout<<"Enter the number of columns in matrix A"<<endl; cin>>n; cout<<"Enter the number of rows in matrix B"<<endl; cin>>p; cout<<"Enter the number of columns in matrix B"<<endl; cin>>q; if(n!=p) { int …

Member Avatar for cikara21
0
177
Member Avatar for Icebone1000

Hi, i was tring to figure how set display mode to fullscreen under win2000, i saw at msdn that theres a SetConsoleDisplayMode, but that is for winXP +.. I tried [CODE] //sets the console window //to fullscreen void FullScreen(){ HANDLE consolehandle; int sysmetrics_x=GetSystemMetrics(SM_CXFULLSCREEN);//get full width int sysmetrics_y=GetSystemMetrics(SM_CYFULLSCREEN);//get full height COORD …

Member Avatar for marco93
0
171
Member Avatar for NinjaLink

Hello, I'm having a simple problem. For my program, each song has an id number which stores the songs information. For my deleteSong function, I am asking the user what id of the song does he/she wants to be deleted. After the user enters the id of the song he/she …

Member Avatar for NinjaLink
0
146
Member Avatar for Gamergirl22

Hi, I have a program problem with converting decimals to binary and back again. My teacher said that the program is to be like a menu and convert decimals or binary from the user's input. This is part of my code: [code=cplusplus] #include <iostream> #include <string> using namespace std; void …

Member Avatar for Gamergirl22
0
179
Member Avatar for maxicube

how would I get the install directory of another program, the registry perhaps? (using HLDS as my directory to be found) [URL="http://storefront.steampowered.com/download/hldsupdatetool.exe"](GET HLDS HERE!)[/URL] i fond the key which might be useful. (how would i open it? [CODE][HKEY_CURRENT_USER\Software\Valve\HLServer] "InstallPath"="C:\\hlds" "Full Name"="Half-Life Dedicated Server" "Region"="5" [/CODE]

Member Avatar for maxicube
0
127
Member Avatar for dapcigar

I've been trying to convert my Modular programming code from array to link list.. the whole program is kinda messy now.. could anyone help me figure out what problem am having with the code? PS: am using Vc++6 to compile... Thanks in Advance

Member Avatar for minas1
0
86
Member Avatar for kyosuke0

whenever the clearMemory function is called i get a segmentation fault and i can not figure out whats wrong. The function is supposed to delete all pointers. The function brings in the pointer to the linked list by reference. The nodes in the list are structs i named bus that …

Member Avatar for rajenpandit
0
136
Member Avatar for alexdm50

hi im new to daniweb im currently working on a piece of work. the idea is to create a bank account with deposit and withdrawal functions. create student business and current accounts (this is all roughly done and a case of copying and pasting for each account type with a …

Member Avatar for Lerner
0
147
Member Avatar for TheBeast32

Hi, I was told that you can crash Windows in C++ or C by "corrupting the kernel", and I wanted to know if this was actually possible. If anyone knows if this is possible, or how it happens, please tell me. ;)

Member Avatar for William Hemsworth
0
180
Member Avatar for jbrock31

Hello everyone. I need help using an instance of a class in another. Below are two header files. NumDays.h and TimeOff.h I need to have instances of the NumDays class in the TimeOff class as members. When i try to create the instance called maxSickDays, i do not get access …

Member Avatar for jbrock31
0
556
Member Avatar for maxicube

OK, I'm making a backup application and once the backup is complete, I want it to flash FINISHED!!!! - in different colours - any help at all would be appreciated, thanks - MaxICube

Member Avatar for maxicube
0
153
Member Avatar for number87

I am creating a linked list which links a struct of data together. However, this is my problem, if I declare struct Node first then the Event type wont exist, but if I declare struct Event first then nodePtr wont exist....im kinda stuck here as to how I should declare …

Member Avatar for number87
0
553
Member Avatar for SoprtsFilmer

I am having a problem with a program. I have to create a program with about 8 different functions. Which reads in votes, finds the max, the min, prints the votes, prints the max prints the mid, finds the normalization, outputs how many are below .25 and above .75 and …

Member Avatar for vmanes
0
361
Member Avatar for mstrofdrgns

hey there , Im taking C++ courses in my collage (so ım a newbie) and they are teaching programing language a bit different from the examples in this forum. [code=c] #include <stdio.h> int main (void) { int x; int y; int z; int min; printf("enter 3 numbers : "); scanf("%d …

Member Avatar for Ancient Dragon
0
140
Member Avatar for Lokolo

[code] void writingTransactionToFile(string transaction) { string temp; int test; ifstream myfile("transactionlog.txt"); ofstream tempfile ("tempfile.txt", ios::app); if (tempfile.is_open()) { tempfile << transaction; if(myfile.is_open()) { while(!myfile.eof()) { getline(myfile,temp); cout << temp; tempfile << temp << endl; } } else { cout << "Unable to open file."; } tempfile.close(); myfile.close(); } else cout …

Member Avatar for brechtjah
0
172
Member Avatar for MJFiggs

I have had this problem a couple of times but i am unsure of what it means. could someone tell me what the error message "non-lvalue in assignment" translates to in english, please?

Member Avatar for MJFiggs
0
163
Member Avatar for rhoit

I decided to learn the template any how.... but... Each level is giving me the trauma staring up with the domino one after another.. please help.... Problem is I use both printf(); and cout<< for the console output... now the problem lies that i can't just leave one of them.. …

Member Avatar for StuXYZ
0
104
Member Avatar for mshefa

[code=cplusplus] #include <iostream> using namespace std; int CelsiustoFahrenheit() { float celsius; cin >> celsius; float fahrenheittemp; fahrenheittemp = celsius * 1.8 +32; }; int FahrenheittoCelsius() { float celsiustemp; float fahrenheittemp; cin >> fahrenheittemp; celsiustemp = (fahrenheittemp-32)/1.8 ; }; int main() { int choice; float celsiustemp,fahrenheittemp; cout << "1.Celsius to Fahrenheit" …

Member Avatar for mshefa
0
2K
Member Avatar for CMacDady

I have been writing a Loan Program that requires at one point to read a .txt file and create an array from the contents. This part is nothing new to me. The problem I have is a single line of code and I cant figure out how to make it …

Member Avatar for CMacDady
0
143
Member Avatar for Stefano Mtangoo

Hello Developers! I have been searching for long lame binding for python and have no way but need to learn ctypes to use lame_enc.DLL. For Now I need simple DLL with simple functions to play with. My Question is: Where can I get that simple yet safe DLL to play …

Member Avatar for Stefano Mtangoo
0
153
Member Avatar for egolovin

Hi all i am working on a memory game and i am having problems inputing the data so it checks if a 3rd number is pulled up to ignore it thanks in advance [CODE]int card[6][6],total=0,value,test; srand((unsigned)time(NULL));//randomize timer for (int i=0;i<6;i++) { for (int j=0;j<6;j++) { value=rand()%18;//random test=0; card[i][j]=value;//sets the value …

Member Avatar for egolovin
0
285
Member Avatar for davids2004

Write a program that calculates how much a person earns in a month if the salary is one penny the first day and doubles each day worked. [B]The program should ask the user for the number of days worked during the month[/B] and should display a table showing how much …

Member Avatar for VernonDozier
0
150

The End.