49,761 Topics
| |
Hi guys, What am I doing wrong here? Program dies on me @ merge(). :( [code=cpp]#include <iostream> #include <vector> using namespace std; int main() { int afrom[4] = {0,0,1,2}; int ato[4] = {1,2,3,4}; vector<int> from(&afrom[0], &afrom[4]); vector<int> to(&ato[0], &ato[4]); vector<int> length; vector<int> all_nodes; sort(from.begin(), from.end()); sort(to.begin(), to.end()); merge(from.begin(), from.end(), to.begin(), … | |
// [code=cplusplus] #include <stdio.h> int main (void) {int currentornew; /*This is where if the user inputs a 0 they will automatically be brought to insert hours for employees.*/ int newemployee; /*This is where if the user inputs a 1 they will autmatically be taken to information of adding a new … | |
I am new to .NET and have been unable to get data from a CSV file to a dataset. Most examples are VB and C# which need to be converted. The code below compiles clean but does not fill the dataset. I have been unable to set a watch on … | |
I am working a program that imports functions from a file, and stores them as Polynomial objects in a linked list. I have been given a linked list class already built. But i have to make a Database class that performs other operations. I am stuck on one that requires … | |
Hello everybody, I'm having a problem with my conpiler. Below is what I typed but it is giving me Can anybody help me? 7 parse error before `float' 10 `fltMoney' undeclared (first use this function) 10 (Each undeclared identifier is reported only once for each function it appears in.) 13 … | |
Hello guys , i recently started programming in C++ , and i am trying to create a text-based RPG in prompt console ... what my problem is that i have my main function , calling one other function name infomisc , in infomisc function it let you choose , 1. … | |
Hi Friends, I have a requirement like in a CPropertySheet i need add four property pages, in that first two pages should contain Wizard mode property of CPropertySheet & the next two pages should behave like a normal mode. The current problem is that if i call 'objPropertySheet.SetWizardMode()' before 'objPropertysheet.domodal()', … | |
Heres the code, im pretty sure i missed something really stupid, No matter what number i type i get "The number oyu type must be a positive number" so i guess the problem is either in my if statements in main or in the checkuserinput function, most likely in my … | |
hi eveyone i need to edit person name or Appointmendescription but not date or time in my program. i can write all the records to the file and can read from the file. and need to edit the file now. can anyone help???? thanks.. [CODE] void writeAppointmenRecords( ) { int … | |
I have a hole host of questions about this but i don't have a clue as to how to do them ... here is one .. im hoping to see exactly how its done so that i can do the rest.. thanks Execute the following sequence of operations on an … | |
As part of an assignment I am creating a class to handle rationals with numerators and denominators, overloading the operators for cin and cout, as well as +-*/. So these are the functions for those operators, now where exactly should I include these in my class? [code] Rational addition(Rational a, … | |
Been working on this project for the past two days and tried googling for solutions and about every 5th solution led me here, so I decided to join and see if I could get my question answered. Here's what I need to do, this is a semester long project for … | |
Bah, once again I am beat by the computer logic... Anyone have an answer as to why it gives me an error: "Expected a constant expression at msg" Here's the code, [CODE] const int INFOWND_SIZE = 4; int msg_length[] = "Message"; double calc_amount = (double)msg_length/(double)INFOWND_SIZE; int msg_amount = (int)ceil(calc_amount); char … | |
For the most parts I believe my program is correct, when compiled it doesn't show any errors. The problem that I do have is that I cannot the information on my linked list to print. When the print out comes out it's suppose to show a list of names instead … | |
I need an example on downloading an internet file in a windows service application before logon using c++. | |
hey, I want to read internet data through a C++ program. I am told that the way to do this is by using a proxy server and spitting out the data through the proxy to a file which then can be read. How exactly do you setup a proxy server … | |
Hi pals I have three qestions 1-Is it possible to overload {} operator? 2-What is the benefit of using function objects other than functions? 3-How can i access CPU serial number and such a things? | |
The title says it all i want to make 1 file which can store information which my C++ program can read and use. How do I go about doing this. | |
Hello there. What is usually the reason of getting an undefined reference error? I have already included the [B]pthread.h[/B] header file yet I'm still getting the undefined reference error for the [B]pthread_create() [/B]function. *sigh*. I'm using makefile in compiling my code. Is there someone here who could enlighten me? Thanks! … | |
Hey, im trying to delete an element of an array of pointers of a class, how can i delete just a single element? my code is basically this... n =8; ClassName *newName; newName = new ClassName[n]; how would i delete for example, element 3, while being in that element... if … | |
Hey I'm just starting to learn how to program and right now I am making a C++ tool with a Command line interface in Xcode 3 and this is my code. [code=cplusplus] #include <iostream> using namespace std; int main() { //declare input output variable double base=0.0; double height=0.0; double area=0.0; … | |
Hey all. Im working on a project that manipulates Wav files such as being able to add an echo to it and so on. So far ive managed to read in the Wav, split it up into the header file and data and manipulate the data by adding an echo … | |
My main code variable declaration (just declaration no login statement) [CODE]struct AXEMAN{ int lvl; int att; int hp;}; struct DEFENDER{ int lvl; int att; int hp;}; struct ARCHER{ int lvl; int att; int hp;}; struct SPEARMAN{ int lvl; int att; int hp;}; struct ROUGE{ int lvl; int att; int hp;}; … | |
Assume you have a hard disk with the following specs: • Has 4 platters • Has 4096 tracks per platter surface • Has 512 sectors per track • Has 256 bytes per sector • Rotates at 8,00 rpm • Average seek time: 4 msec Write a program that roughly simulates … | |
i am new to c++ and wonder about how i create a file for example string flight; cin>>flight; flight=flight+".txt"; ofstream myfile; myfile.open(flight); instead of having a fixed name like myfile.open("file.txt") but it doesnt work , are there elegant solutions to this problem i have. all the help is appreciated. | |
I need to be able to get rid of spaces in a string. All strings are representations of functions: 3 * x ( 1 ) + 1 * x ( 3 ) + 6 * x ( 2 ) – 10 * X ( 0 ) and i have to … | |
Hello In my program, the function [B]largest_prime_factor[/B] is not being called/working? Can you tell me what may be wrong? The function [B]largest_prime_factor[/B], should return the largest prime number of the variable [B]n5[/B] (n5 = n3 + n4). Plus if you see any other errors or maybe a better way of … | |
I'm trying to store a list of names in alphabetical order, while implementing this linked list, but I've bumped into some errors. This is what I have: Node.h class node {public: node(node* , node* , node* , node* , node* , node* , node* , node* , node* , node*); … | |
Hi, I have built a text based adventure game. The last thing I have to do (this is for an assignment), is ask the user if they want to play again. So, I thought the code below would probably be the best way to do it, seeing as I don't … | |
Ok I need to know how to set my class to read only the values after the = sign. Here's my class so far. [CODE] #include <iostream> #include <string> #include <fstream> using namespace std; class Config { int pos; string search; public: char * confname; void configsearch () { fstream … |
The End.