49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
[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 && … | |
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" … | |
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? … | |
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 … | |
[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 () { … | |
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 … | |
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... | |
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 … | |
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... … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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 … | |
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. | |
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 … | |
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. | |
[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 … |
The End.