49,761 Topics
| |
Why would I get a Segmentation Fault error? It compiles fine with g++, but gives an error when it runs. [code] void blowUp(char *board, int *boardSkin, int row, int column) { //set the board's 'skin' to 1, (meaning it will be displayed) *(boardSkin +(row * columns) + column) = 1; … | |
Here is the [url=http://dl.getdropbox.com/u/297962/Lab7.zip]whole project[/url], in a zip file. I'm having trouble getting the delete function to work. I can delete head just fine, but when I try to delete either something at the end, or something in the middle, it does not work out. I'm sure it has something … | |
HELP ME!!! /* Read from a file called “data.txt”. <ID> <Product> <Number ordered> <Manufacture Price> <Selling Price> Example Input: 1111 Dish Washer 20 250.50 550.50 2222 Micro Wave 75 150.00 400.00 3333 Cooking Range 50 450.00 850.00 4444 Circular Saw 150 45.00 125.00 */ #include <iostream> #include <fstream> #include <string> … | |
I am having trouble with this program which was solved before, but I am still having an issue with the final code. Here is the assignment prompt: Write a program that asks the user to order an ice cream treat. The user selects the type of ice cream, the type … | |
So I made all the functions for a project where I was supposed to take input from the user through a menu and make an array and do various things with it. Two things I couldnt figure out were how to Lock and unlock the array, and then I also … | |
I have an vs2005 forms application running a thread to constantly try and receive data via ethernet. My problem is once I get the data I want to pass it up through some object oriented layers. When I try to make a call to one of the layers sampleLayer->blah(); I … | |
I need to make a program that will extract numbers from a file sorted like bowling cones, like this: 1 2 5 2 2 7 1 6 4 8 2 9 4 7 3 and than calculate the maximum a bowler can score if the ball can go down on … | |
Hi, I've just started to learn vectors and wonder if there is a way to copy a vector that i use in main to a vector in a class?? | |
Hey. Thanks for all of the help with my other questions. This forum has been very helpful. In this program, there is a note: "chocolate" may refer to either the ice cream or the sauce; assume it refers to the ice cream if an ice cream flavor has not yet … | |
I've been wracking my brain over the last week. I have project due soon, but I'm having a lot of trouble with certain aspects of pointers in class instances. My project is to re-design the String class library by remaking basic functions. I was given a header file and told … | |
i used following command to overcome edit-compile-run cycle while working with vim editor. :set makeprg=g++\ % then i ran the :make command every thing worked fine except that instead of jumping to the first error line in my file the vim editor shows that "[COLOR="Red"]type command or press enter to … | |
when creating a new xml file using xercesC++ all the attributes are ordered alphabetically at the output, how to see to it that the attributes are written in the order they are appended?? also how to associate with an xsd when creating a new xml with xerces C++ | |
I have been trying to compile my program but i get these error messages that i can't understand. Please help. these are the error messages I am getting error: could not convert 'MARITALSTATUS' to 'double&' error: in passing argument 2 of 'double FEDTAX(double, double&, int, int&)' err: In function 'double … | |
[CODE] #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; char your_string[256]; char new_string[256]; void ReverseString(); int main() { char choice; do { cout <<"Enter the string that you want to reverse: \n"; cin.getline(your_string, 256); ReverseString(); cout << new_string << "\n"; cout <<"Do you want to continue? Press … | |
Hi, I have to display the details inside an array as a bar chart, the user has input the temperatures for the twelve months, here is the declaration and the user input: [CODE] int temp[12]; int menuChoice; char month[12][5]={"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};[/CODE] … | |
I am new to C++ and would like to know what style I should use to write my codes. For example, should I use: [CODE=c++] for (int i=0; i < 10; ++i) { cout << i << endl; } [/CODE] or [CODE=c++] for (int i=0; i < 10; i++) { … | |
I can't understand why there's a memory leak. Can someone please enlighten me ? [CODE=cpp]#include <fstream> #include <string> #include <iostream> #include <sstream> #include <stdlib.h> #include <math.h> using namespace std; class ChocBar{ public: ChocBar(string name = "Barone",double price =1.20){ name_ = name; price_ = price; } string getName(){ return name_; } … | |
I'm trying to write a a program that simulates a multi queues, multi server such as a grocery line at the grocery store. The user will enter the desired number of queue/server pair. how would i write this? I mean, I can have 3 - 4 different queue stacks as … | |
Reverse the case of all alphabetic characters in the string. That is, all upper case characters become lower case and all lower case become upper case. Hello World becomes hELLO wORLD. So I figured I need to use the toupper and tolower commands. I'm just not to sure how to … | |
hello there, can anybody please give me an example of how to use hashtables to implement a memory in cpp.. i surfed the net for 2 hours and couldnt find anything :S im not sure whether im submitting the right queries. thank you. | |
ok well first of all i was going to use "a push in the write direction" for the title but i decided it was too stuid haha anyway umm as I am one for pointless trivialities i want to code a program that rains streaming data from the top of … | |
Hello, i have a question for my C++ program. void GasPump::setHighGal(int gallons){ gallons = 0; } void GasPump::setMedGal(int gallons){ gallons = 0; } void GasPump::setLow(int gallons){ gallons = 0; } Those functions will sets the quantity of gas in the indicated tank to parameter value,resets total cash for that type … | |
Hi, Does someone know about drawing a window in a Memory Device Context, I need this so I can then read pixels from a window that is behind other windows. I need this for windows XP, not Vista. Thx in advance. | |
Hi There, I have to do this read a list of names from an input file of my own, In main() I declared a Namelist[][] object, read several names from thefile using redirection and then print out the list. I have to add the name to the list only if … | |
i want to implement a memory using c++ language. the memory will contain addresses of length 64bits because in my architecture the word is 64 bits. i want to implement it using a set associative array. so i want to create a 2 dimensional array of dimension 8 and 16k … | |
I have a function which outputs a really long string in a box of defined size. The problem is, after a few lines, I get an error saying that HEAP CORRUPTION has occured and I wrote to a memory beyond the allocated limit. Now, I'm only writing to console and … | |
hello every one here, hoping u're all doing fine. i am face with a wierd error while trying to encode a class about courses and students ( student is itself a class) i'm give this error, and googling seems of no help! [COLOR="Red"]error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> … | |
Hello! I am writing c++ program on linux. Whenever I read a char or string, I got problem. In c, I sove the problem using if(getchar()=='\n') in c++, how can I sove that problem? Here is my program. I cannot do any input for name. Please help me. [code] #include<iostream.h> … | |
[TEX]can someone teach me how to use pointer in this program?? i dont know if what i did in this program is correct. can you tell me how to use pointers here.thanks! [/TEX] [CODE]#include<stdio.h> #include<iostream.h> struct fruits { int apple; int banana; int orange; int jackfruit; } fruit; int shape; … | |
[TEX]quick question, I can't figure out how to change the position doing it this way. It isn't changing position.[/TEX] [CODE] this->a1->Location.X = this->a1->Location.X + 20; this->a1->Location.Y = this->a1->Location.Y + 20; [/CODE] |
The End.