48,985 Topics

Member Avatar for
Member Avatar for react05

How would I get the code below to time both the iterative version and the recursive version of the Fibonacci function so that I can see which one is faster. I already have the timer.h file to go along with it. I'm thinking i should use t.start() and t.stop() to …

Member Avatar for Software guy
0
129
Member Avatar for LevyDee

Basically, I need to figure out how to change a buttons text when its clicked(X or O). [code] button1 = CreateWindow(TEXT("BUTTON"), TEXT("1"), WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 10, 10, 50, 50, hwnd, (HMENU)ID_BUTTON1, myInst, NULL); [/code] Im using buttons like this. I have it set up in the WM_COMMAND case …

Member Avatar for Software guy
0
145
Member Avatar for tom384

Hi guys, I'm implementing a viewer for skinned character animation. Each frame of animation requires thousands of (4x4 matrix * vector) and (float * 4x4 matrix) calculations. This is the section that is repeated thousands of times: [code] // For each vertex influenced by bone for (int j=0; j<(int)Character::bones[i].get_vertices().size(); j++) …

Member Avatar for nezachem
0
159
Member Avatar for jarrevard

I am making a linked list template. a can search a string input and determine if it is an int. i can declare a node of type int or string. when i try to add to my list, my string node cannot point to an int node and vice versa. …

0
23
Member Avatar for timbomo

i have my questions commented in the program . i had to put most of program up so you could see what im doin. please help PROTYPES [CODE]void side_on_die(int& ns1,int& ns2,int& ns3, int& ns4, int& ns5, int& ns6); int roll_hold(int roll, int answer, int turn); int if_roll(); void if_hold();[/CODE] [CODE]int …

Member Avatar for timbomo
-1
117
Member Avatar for pinknblu

It's saying I have 6 errors. Need help, please..or a push into the right direction. Thank-you. :) [CODE]#include <iostream> #include <cctype> using namespace std; int Len_String(char *); int CountCapitals(char *); int CountVowels(char *); int main() { char msg[] = "Strayer - what a University !"; char msg2[] = "Programming is …

Member Avatar for pinknblu
0
133
Member Avatar for vivosmith

Hello I am glad to find this site. I have been searching for help with learning C++, to no avil. So my question, which is multi-fold: I have a book from 10 years back or so, ansi compliant, should it work with dev-cpp. Second, I learned the difference between char …

Member Avatar for vivosmith
0
564
Member Avatar for react05

how would i get the file below to display the number of moves by adding an output statement after the call to move() in main() to display the value of moveNumber, which will be the number of the last move. Thanks! [code] #include <iostream> #include <iomanip> #include "timer.h" using namespace …

Member Avatar for Fbody
0
178
Member Avatar for kut KK

hello guys... can you help me to find coding for grading system for my new assingment...( grade n grade point) grade A= 4.00 A- = 3.70 B+ = 3.50 B = 3.00 B- = 2.67 C+ =2.50 C = 2.00 C- = 1.67 D+ = 1.33 D = 1.00 E …

Member Avatar for MyrtleTurtle
0
227
Member Avatar for MyrtleTurtle

My assignment this week deals with using a struct. I think I can do that part. What I'm having trouble with is reading the file into each variable. The first item in the file is text with spaces. The next items are numeric and need to go into other variables, …

Member Avatar for MyrtleTurtle
0
122
Member Avatar for syd919

hello everyone I am teaching myself c++ and I was wondering if anyone could give me a site that has some c++ exercises particularly on 2d arrays and string manipulation. thank you.

Member Avatar for syd919
0
76
Member Avatar for josolanes

Hi, I'm writing a "Date" class and it's fully functioning, including the output manipulators, but the issue I have is when creating a class the has a "Date" instance in it. It, then, doesn't compile because it says there are multiple definitions of the manipulator functions. I'll lay out, below, …

Member Avatar for josolanes
0
99
Member Avatar for mucoool

i'm having a problem in executing a batch file from my c++ code i've included all the necesary headers like dos.h,process.h,stdlib.h code: system(c:\new\ram.bat); there is no error in the program but the batch file does not get executed..... please help ................

Member Avatar for thomas_naveen
0
204
Member Avatar for gaya88

can we declare a array as, int arre[x]; and assign the value of x as,x=5; but error is coming "constant expression required." Any help? i wanted to input series of marks,first you should enter how many subjects(if 5 subs,x=5) then you can enter 5 marks.

Member Avatar for thomas_naveen
0
168
Member Avatar for ahmedyes

hi every one I really need help with this and how to do it =The motel has 12 rooms numbered 1 to 12, and each handles a maximum of 4 guests. Assume all rooms begin empty. Provide a user-friendly interactive menu that allows the following transactions: B – Book room(s) …

Member Avatar for thomas_naveen
0
163
Member Avatar for ilkeamasya

Our homework is to compare N circles with each other if they are intersecting or containing.My C file for that is : [CODE]int N=0 , i=0, j, a=0, max=0; float circle[MAX] [3] ; float durum1, durum2, durum3; float intersection[MAX], containment[MAX]; printf("Please enter the number of circles you want to compare …

Member Avatar for ilkeamasya
0
88
Member Avatar for mrnobody

Hi, I've got a modeless dialog. When user click the X button at top right hand corner, I want to catch the event and do some processing. What event do I use for that..? I cannot find OnClose event in the event handlers box. Btw, I'm using VC++ 6 (MFC). …

0
61
Member Avatar for timbomo

#include <iostream> #include <ctime> #include <cstdlib> using namespace std; i am having trouble putting functions in int main(). can someone show me how??? i want to put these function def. in int main() [CODE]int score_num(int& ns1,int& ns2,int& ns3, int& ns4, int& ns5, int& n6, char& gam_answ); int roll_hold(int roll, int …

Member Avatar for mattjbond
0
412
Member Avatar for jazzy_24

firstly here is the code i'm working on in visual studio [CODE]#include "stdafx.h" #include <iostream> #include <string> using namespace std; struct Car { string r_number,make_of_car,model_of_car; int mileage; int age_of_car; }; void main () { int i,num; Car *car1; cout << "Please enter the number of cars: "; cin >> num; …

Member Avatar for pinsickle
0
116
Member Avatar for PSP1202

Hey all I'm new C++ and am having a little trouble with a simple program. The program calculates the square root of a number the user inputs. When I input -1 or any negative it comes up as 1.#ind. Ideally when the user types -1 i want -1 to come …

Member Avatar for Banfa
0
219
Member Avatar for ratchy

So I have been asked to write a template class for a binary tree (easy) the hard part is that the nodes have to be written into a file and read in the same exact positions they were in when they were stored. I looked at the array solution with …

Member Avatar for ratchy
0
257
Member Avatar for some

Hello everyone, Currently, I am trying to make a smaller version of the famous Eliza bot. I have written a program that can understand and put out replies, but if I want to make it bigger then the code will be thousands and thousands of lines long. And all on …

Member Avatar for Banfa
0
187
Member Avatar for MTW1989

[CODE] #include <cstdlib> #include <iostream> #include <iomanip> #include <stdlib.h> #include <conio.h> #include <stdio.h> using namespace std; void printintromessage (); void getUserInput (char& Y); void calculations (const int& numofgamesinseries, const int& numofplayersonteam, int& i, int& j, int& k, int& l, char& Y); void PrintMax (const int& numofgamesinseries, const int& numofplayersonteam, int& …

Member Avatar for pinsickle
0
131
Member Avatar for DSalas91

Hi everyone. Im new in C++, actually im doing my first project, and i have a few questions, if you guys could help me it would be awesome. :) In a method i have to create a .txt file, It have a parameter indicating the number of the file. But …

Member Avatar for DSalas91
0
180
Member Avatar for mrnobody

Hi guys.. In my dialog, under void Class::DoDataExchange(CDataExchange* pDX), whenever i call DDX_Control(pDX, IDC_SOMETHING, m_VAR);, I got problem. After some digging, the problem is the function below. [CODE]HWND CDataExchange::PrepareCtrl(int nIDC) { ASSERT(nIDC != 0); ASSERT(nIDC != -1); // not allowed HWND hWndCtrl; m_pDlgWnd->GetDlgItem(nIDC, &hWndCtrl); //<---- hWndCtrl = 0 if (hWndCtrl …

0
70
Member Avatar for osha

i want to make a key from keyboard toggle (on and off key ) that's for a polygon in openGl by using c++ this polygon appear when we press this key as solid and when we press this key again it appears wired can you help me thaxxxxx osha

0
30
Member Avatar for timbomo

can someone show me an example of how you would initiate a variable and how you would fix a undeclaired identifiers. i am a visual learner so thats why i ask for an example.

Member Avatar for Jiwe
0
130
Member Avatar for caffeine

I have a bunch of code that looks like: [CODE] // Local block scope { ostringstream ostr; ostr.fixed; ostr.precision(2); ostr.width(20); ostr << foo->bar[trno]; SafeArrayPut2D( retArray, 3, i, (void *) ostr.str().c_str() ); } { ostringstream ostr; ostr.fixed; ostr.precision(4); ostr.width(22); ostr << foo->foobar[trno]; SafeArrayPut2D( retArray, 4, i, (void *) ostr.str().c_str() ); } …

Member Avatar for dusktreader
0
175
Member Avatar for V0ldemort

How can I access (get) the individual pixels of the data in an LPDIRECT3DTEXTURE9? Thanks.

Member Avatar for dusktreader
0
74
Member Avatar for KBL

This program is to accept input from a user to select there own username and then a password which will be compared to the password KazzyB, and give an output saying Welcome, The only problem in it is a single error KB.cpp(18) : error C2447: missing function header (old-style formal …

Member Avatar for KBL
0
25K

The End.