49,757 Topics

Member Avatar for
Member Avatar for fuzmaster

I would like to know on how to solve this particular equation. Create 4 functions Main function Get number of employees (less than 10) Get employees hourly salary Store in an floating point array called salaries Calls calculate pay function Calls print pay function number_of_employee_times Calls print pay function 2 …

Member Avatar for arkoenig
-1
320
Member Avatar for armanus

I'm attempting to make a Tic-Tac-Toe against the computer program, I'm pretty much done, but i can't figure out how to stop the computer from making the exact same move as the human does. Thank You. [CODE]// Include the libraries #include <iostream> #include <string> // Use standerd namespaces. using namespace …

Member Avatar for SgtMe
0
179
Member Avatar for kyros

[COLOR="Red"]I have an assignment from my data structures course.We learn almost nothing about C++.But they gave that assignment,and said do it anyway.Many of my classmates have it done with money.But I wanna learn how to make this project by myself.I'm thinking about the structure for 5 days and nights.I wanna …

Member Avatar for hiddepolen
0
753
Member Avatar for ac20734

I am having problems working on this project about making a baffle game. I have most of the code written already I just can't figure out how to do the shot laser part and determining where the laser exits the box. The point of the game is that there are …

Member Avatar for hiddepolen
0
933
Member Avatar for tonycu

Hey guys, Well looked at a job online (IT consultancy job) and they require good level of procedural c++ programming ... I was wondering if anyone could hep me with any ideas or can show me any sites with advanced project ideas. All I know is linked list which I …

Member Avatar for hiddepolen
0
147
Member Avatar for whaba

Hey guys. I'm new to SDL and C++ and I've stumbled upon a problem here. Here's the code: [CODE]#include <SDL/SDL.h> #include <SDL/SDL_ttf.h> #include <SDL/SDL_image.h> #include <string> using namespace std; const int screenheight = 1920; const int screenwidth = 1080; const int screenbpp = 32; int right,down = 0; SDL_Surface *bakgrund …

Member Avatar for mike_2000_17
0
117
Member Avatar for izzykel

[code] #include <iostream> #include <cstring> #include <fstream> using namespace std; const int length = 25; void insertionSort(int numb, char* anArray[]) { char temp[length]; int pos; for(int i = 1; i < numb; i++) { strncpy(temp, anArray[i], length); pos = i; //moves "higher" letters to the right while(pos > 0 && …

Member Avatar for izzykel
0
1K
Member Avatar for oggiemc

Say i want a friend function to have access to two classes which are derived from the same base..I declare the friend function prototye in both classes, but where do i code the actual definition?? is the code below right?? (mixBreed() is the friend function).. [code=c] // Dog.h #include "Animal.h" …

Member Avatar for mike_2000_17
0
157
Member Avatar for newbyE

Hi, Please help... I am trying to read in a file in C++ and when I use getline I am not able to read in the last line when the last line in the input file does not have a newline (\n) at the end. How do I do this? …

Member Avatar for newbyE
0
7K
Member Avatar for tyczj

i know how to get a file and all but how do u go about putting that file into the tree? my get file [CODE]void BST::loadFile() { cout << "Enter the the file location" << endl; cin >> inFileName; inFile.open(inFileName.c_str()); if (!inFile.is_open()) //test for file { cerr << "Cannot open …

Member Avatar for hoangnn90
0
6K
Member Avatar for lauruskamj

[code=C++] #include <cstdlib> #include <iostream> using namespace std; class fractions { private: int numerator1, denominator1, numerator2, denominator2; public: fractions(int = 0, int = 1, int = 0, int = 1); void read_fractions (); void multiply_fractions (); void add_fractions (); double add_fractions (double); double multiply_fractions (double); }; void fractions::read_fractions () { …

Member Avatar for mike_2000_17
0
94
Member Avatar for nikki33

You are burning some music CDs for a party. You've arranged a list of songs in the order in which you want to play them. However, you would like to maximize your use of space on the CD, which holds 80 minutes of music. So, you want to figure out …

Member Avatar for SgtMe
-2
221
Member Avatar for malayasthana

guys my vector isn't working properly with push back function ... so i am searching for the alternative method ... please help me with your advices...

Member Avatar for mike_2000_17
0
119
Member Avatar for Alkaline8214

Hello everyone. My name is Mike. I am a new member :). I hope to be using this forum quite a bit to extend my knowledge base on c++ and java.(just wanted to introduce myself being my 1st post and all lol) Well my class was tasked with making a …

Member Avatar for VernonDozier
0
4K
Member Avatar for muze

hello guys... I have a file [B]MyClass.cpp[/B] inwhich I declared a vector array. I then added some string data to it and want to access it in [B]MyProjDlg.cpp[/B]. It is dialoged based app in vc6. Here it is [code] MyClass.cpp ----------- using namespace std; typedef vector<LPTSTR> StudentData; //some code here... …

Member Avatar for muze
0
1K
Member Avatar for cppgangster

Hi, My program is trying to read from file Lithuanian words, the language has some additional characters than ANSII character set. The program uses wstring, wifstring classes for reading, but I gotta feeling it is something wrong with input,do I need any special directive to compiler or the language has …

Member Avatar for nbaztec
0
172
Member Avatar for dorien

Hi, I want to copy a row from a 2d vector in an existing 1d vector. I found a similar tread, which copies into a newly defined vector as such: [CODE]vector< data_type > copyRow( vec2d[3].begin(), vec2d[3].end());[/CODE] Now I want to change this code, so that copyRow already exists. My idea …

Member Avatar for dorien
0
1K
Member Avatar for oggiemc

Hi, Im trying to write some code which adds the combined height and weight of two dogs, returns the result and then displays it..The problem is, the result returned is wrong (i think the operation is just adding two memory addresses)..The =operator code is returning rubbish as well, i think …

Member Avatar for nbaztec
0
137
Member Avatar for MasterGberry

I am getting the following two errors, i am lost on how to fix them: Exc_3.cpp(54) : error C2082: redefinition of formal parameter 'name' Exc_3.cpp(54) : error C2440: 'initializing' : cannot convert from 'char[]' to 'char' Here was my original prompt, I think i did part B wrong.....wasn't sure how …

Member Avatar for nbaztec
0
198
Member Avatar for Exile_082

can anybody give me a link or anything that can help me understand switch loops a little bit more im a newbie to C++ so any help wud be highly appreciated

Member Avatar for hiddepolen
0
127
Member Avatar for bshrestha

Hi guys! i am stuck in my fraction program. i hope you guys can solve it. here i have posted my code. i am trying to get for e.g. 4/2 need to get me answer like 2/1 or 2/4 show me 1/2. i hope you can help me out. i …

Member Avatar for SgtMe
0
111
Member Avatar for shubforall

I am searching for a automation to create exe of VC++ project but I don't want to open VC++ IDE. I want to create exe file using command prompt. please help.

Member Avatar for shubforall
0
203
Member Avatar for merse

How can I come to know that the system has done a rounding during a calculation or not? I mean for example 4/2=2 is an exact calculation of doubles because 4 and 2 are represented exactly. But for example 4/3 is not an exact calculation. I would like to know …

Member Avatar for merse
0
229
Member Avatar for joy55

How can I create a code for this task? *You are given a natural number m and natural number n =2, .,.,.. 16. Print the number m in counting system with base n.

Member Avatar for maria198
0
167
Member Avatar for lochnessmonster

[CODE]myclass::myclass(const std::wstring& processName,const std::wstring& dllName) { if ( (isValidDll(fileName)) && (isValidProcess(processName)) ) { this->dllName = dllName; this->processName = processName; memoryAddress = NULL; } else { throw; // what kind of exception should i throw for invalid arguments? } }[/CODE] im quite new to c++ exceptions and im curious to what …

Member Avatar for Milton Neal
0
75
Member Avatar for kra9853

Heres the question:Develop the code and example values necessary, to demonstrate to a user, the differences in execution of the following four statements: [CODE]{ ++count; count++; --index; index--; }[/CODE] here is my attempt [CODE]int main (void) { int count,index; count=1; //intialize count while (count <= 10) { cout<<count<<" "; ++count; …

Member Avatar for getnit
0
98
Member Avatar for hondros

Hello, I'm trying to take a C array of char's and trying to take all of the spaces out of it. Yet I keep running into a segmentation fault. Can anyone help me here? [code] #include <stdio.h> #include <stdlib.h> int strlen(char* Str) { int toret=0; int i=0; char tmp = …

Member Avatar for VernonDozier
0
204
Member Avatar for aaronmk2

Can someone explain to me what is going on in this code. I am leaving comments by each line. [CODE] void qs::quicksort(int set[], int start, int end){ stack<int>s;//starts a stack to hold them elements s.push(start);//why push two elements, why not one so the while loop works s.push(end); while (!s.empty()) { …

0
58
Member Avatar for thetooth

So i am working on a platformer which has tiled graphics. The physics system on the other hand is not tiled, it uses vector boxes as an efficient way of doing collisions and the actual tiling is done at draw time. Heres the problem, all of my tiles are 16x16px …

Member Avatar for thetooth
0
100
Member Avatar for tfmontague

How do I make an array (or an abstract data type) which can hold different data types? Then use those data types to create instances. I want to do the following: [code] int arrayType[3] = {bool, int, char}; /*arrayType[0]*/ myBool = true; /*arrayType[1]*/ myInt = 2; /*arrayType[2]*/ myChar = "a"; …

Member Avatar for alwaysLearning0
0
187

The End.