49,761 Topics

Member Avatar for
Member Avatar for tKc

have been working on a program that should output the values of an array from lowest to highest order, my program runs but its ouputing -1.#IND which is clearly not right. Im pretty sure im messing up somewhere when i call back to my my function with selectionSort(array, N) but …

Member Avatar for tKc
0
161
Member Avatar for dnambembe

Hi, I am writing a code that reads input from user to create a linked list database at the same, time it write the data received in to binary file. when I run the program is supposed to prompt the user to enter the data for ten time, however the …

Member Avatar for dnambembe
0
1K
Member Avatar for Obsidian_496

Hello. I've created a program which calculates points which belong to a specific graph, such as Archimedes spiral, Logarithmic spiral, Cardioid etc. The program generates an array with coordinates. Technically coordinates are polar, but I can convert them to cartesian by using polar() function. Question is - how do i …

Member Avatar for mike_2000_17
0
704
Member Avatar for anglwthnati2de

Hi guys. I am hoping for a little help with this. I am pretty new to programming and just can't seem to get things right yet. Here is my code. It returns like 40 errors. Way messed up eh? [CODE]#include <iostream> #include <string> using namespace std; class Date { public: …

Member Avatar for anglwthnati2de
0
195
Member Avatar for biju127

Whats wrong with this code. I can create the DAT file.Name and Grade is writing to the file perfectly. but the file contains ASCII values for RollNO and after Grade. [B]Output file:[/B] Name A ÈB [B]Program[/B]: #include<iostream.h> #include<conio.h> #include<fstream.h> #include<string.h> class stu { int rollno; char name[20]; char grade; float …

Member Avatar for biju127
0
214
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
755
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
944
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
119
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
174
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
128
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
77

The End.