48,986 Topics
| |
uuhm.. im my program.. MY prof wanted me to have some text color and back ground color.. will you suggest what codes I should use? and where Should I place them? thank you! | |
I was wondering, how do I put in an index number for n elements. The program provided asks you to enter the numbers and it puts them in descending order, but I need an index number to be put with the values you enter for n to be the same … | |
I get the right input, but its giving out the numbers unformatted in the output ie: when it should be input: 3 5 (7) $58 3,400 output: 3 5 -7 58 3400 it gives me 3 5 -7 5 8 3 4 0 0 [code] inFile.get(aa); while( ! inFile.eof()) { … | |
Im trying to find out if something is in this linked list function and if it is to return true and if not return false. How do you find out if ThingType thing is in the list? [CODE]bool Thelist::Search(ThingType thing) const { Node* current; current=listPtr; while(current->thing != listPtr->thing) { } … | |
I need major help. My program will compile but when I run it I get a segmentation fault. I don't know how to run a debugger with multiple files. Could someone please find when this error occurs? My project is due in 2 hours. | |
Hey All - i am currently working on an assignment for a computer science programming class. I have to find and print all the prime numbers from 2 to N (N being a number read in from file). I have some code but i do can not get my mind … | |
here is the assignment . To make telephone numbers easier to remember, some companies use letters to show their telephone number. For example, using letters, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone number more meaningful, companies might use more than … | |
I need an array listing the index number for a list of n elements and when I sort it in descending order, I need that same number to be with the element. Here's the code I have so far: [code] #include <iostream> using namespace std; int Partition(int low,int high,int arr[]); … | |
I had a hard time understanding the concept of memory in a computer, but something my Instructor told me gave me some hope. He mentioned that memory isn't really created upon invocation of "new" in C++, and stated also that memory isn't really removed upon the invocation of "delete." I … | |
let's have a look at this High School Programming League, to join the contest one must pay for it, is it ok? if you are newbie in C/C++-programming, it is a great chance to improve your skills! | |
Hey guys, this is my first post and I would like to say thank you to all of you guys out there that are doing such a great job with helping out on this forum. Anyway, lets get to the question. Why, in the code below, does the char values … | |
I can get everything to run perfectly, it is just when I print out the final grade, it will just give me a blank for it. Maybe I'm doing something wrong in my finalgrade function, but i don't know....I need help! [CODE=Cplusplus] #include <iostream> #include <iomanip> using namespace std; const … | |
Hey guys, Well i've been wondering something. How would you go about doing something like say if 'a' or 'A' is pressed do something for example move a file. Thanks, Clipper34. | |
I wan't use the multimap on my own templated class. The following is a working example with a builtin type. [CODE=c++] int dat[5] = {0,6,3,7,3}; typedef std::multimap< int, int > asso; asso dict; for (int i=0;i<5;i++){ dict.insert(make_pair(dat[i],i)); } asso::iterator pos; for(pos=dict.begin(); pos!=dict.end() ;pos++) cout << pos->first <<" next "<< pos->second … | |
Write a program that asks for the name of a pole vaulter and the dates and vault height (in meters) of the athlete's three best vaults. It should then report in order of the hieght (best first), the date on which each vault was made and its height. Input Validation: … | |
hi, I'm a Computer Engineering student from Portugal in the 2ºterm. Last class' job was for us to use class and sub-class systems, creating a info system for vehicle types. I thought I was finished, but when I did the main file, the compiler shouted loads of errors that didn't … | |
hello,I would like to create a class for basic file operations-just reading and writing a line.There seems no error in my program but it doesn't output anything.I think there is a problem with the functions for reading and writing.Please help... [code=C++] #ifndef HANDLER_H_ #define HANDLER_H_ #include <iostream> #include <fstream> #include … | |
Hey, Does anyone know any good packages that include a way to create 2d ghx along with GUI for C++. what I've got atm is wxwidgets for GUI and allegro for 2d ghx. I do not know how to combine the 2. So if someone cud tell me how to … | |
I am drawing on a bit my, then re-loading the bitmap(to erase it) then drawing on it again at 100Hz. I am getting flicker. Is there a way to reduce this flicker? Or a better way to do this than to reload the bitmap everytime? Thanks. | |
Hey, ive written a piece of code which reads from a file called test.txt. all it does is use strtok to seperate the data from the spaces because there are alot of them, and then print them out, this worked fine when i did a test for just 1 line, … | |
I am having difficulty with nested loops. I am attempting to create a program that has the user enter monthly data during the course of a three year period. here is what I have so far. [code=C++] #include <iostream> const int Months = 12; const int Years = 3; int … | |
i need help removing spaces from a string..how do i go about this?? i have to report back the number of spaces too but ive been able to do that thnx (i dont want to use any of the string functions in the string library) [code] #include <iostream> int stripspaces(char … | |
Ive been given a task where i read in a line of text from a file, and then need to seperate that line into seperate strings, ive done this however I also need to keep some attatched... the file contains "abc def ghi jkl mno", this is read in using … | |
I have been working on this assignment for a while and cant get the end result to work. Can anyone help? Assignment [QUOTE]Write a function called sumTo that takes as arguments two integers. Your function should use a loop to sum all of the numbers between the two (This includes … | |
Sorry for asking the topic that asked before... but im still dont know how to use that.. Below is an example create by me.. I hope that someone can tell me which part have to fix ... This is the header file: [CODE] int check_SkipCard (string input) { int SkipCard=0; … | |
I have a problem with bulding a program to store a family record (genogram), this record consits of : name, birthday, married? and number of child. What is the best way to store this record??? Could you give me some example about some task on this structure : Input name … | |
I am using a List where I wonder how it is possible to find the MaxValue searching trough Value1[0] until Value1[3]. In this case it should return: 12 I have found a ::Max function but this will only consider the 2 values inside the paranthes wich then will return: 100. … | |
I am using this in the std:: to check for the first occurance of " " backwards (rfind). If I go managed .NET, I wonder if there is any simular method for this using str-> [code] std::string::size_type index2 = str.rfind(" ", index - 1); [/code] | |
Hey all, i'm a freshmen in college who is taking Intro to Computer Science with C++ and i'm just a beginner when it comes to programming so i have a problem. This is our assignment: [B]You are to write a program which inputs a Celsius temperature from the user, converts … | |
I am having a lot of trouble with a Divide and Conquer algorithm to count the number of white cells and white cell blocks in a grid of black and white cells. Here is my grid file "cells.txt": w = white cell b = black cell [CODE] bbbbbbbbbb bwwwwwbwwb bbbbbwbwwb … |
The End.