49,761 Topics

Member Avatar for
Member Avatar for Frederick2

[CODE=C++] /* I'm stuck! Here is what I consider to be a perfectly running program that uses an array ( TArray ) template to hold arrays of objects. Its just about your classic text book example. Its pretty well stripped down to nothing to illustrate my problem. I simply don't …

Member Avatar for Frederick2
0
197
Member Avatar for TimeWalker

Here's the code that increases x value by 0.01 increment and outputs: x, placeholder for initial x+t and how many loop cycles it took to find a solution to the equation in function f1() in intervals for temp (0.5 ; 1.0)U(1.0 ; 1.5). [code] #include <iostream> #include <cstdlib> #include <cmath> …

1
58
Member Avatar for lotrsimp12345

Is my understanding of a vector list correct. vector<list<int>>. The vector holds a list of data type int? [CODE] class my_ht_chain { public: //constructor which creates a table of a certain size my_ht_chain(int size); //destructor ~my_ht_chain(); //insert a value based on key void insert(int key); //search for a value based …

Member Avatar for lotrsimp12345
0
94
Member Avatar for halluc1nati0n

I have trouble understanding the compilers. The following code does work in UNIX under g++, but under VC++ it would not even compile. Anyone can provide valid reasons why? [B]Code:[/B] [CODE]#include <stdio.h> #include <iostream> #include <string.h> using namespace std; int main() { string tmp_nw_msg, crc_chksum, buffer; cout << "Enter the …

Member Avatar for Nick Evan
0
243
Member Avatar for stevechow

My program takes numbers from a .txt file then puts it in, so that an array has a "bacteria" in it. The "bacteria" will die if it has 4 or more, or if it has 1 or less. It will live with 2-3 neighbors. If an empty cell has three …

Member Avatar for Nick Evan
0
107
Member Avatar for grib

Just got back to my interrupted attempt to pick up C++, and I'm already shipwrecked again. Anyway... I'm trying to build another bitty app from my text, but nothing seems to be coming together properly. The program should ask for an array length, send that to an input-handling function, then …

Member Avatar for grib
0
377
Member Avatar for merse

It is possible to choose template parameter in runtime? when i try to construct an object wich has template parameter

Member Avatar for mrnutty
0
105
Member Avatar for keyzzz_it

hi!!! im a new member of this organization of the IT's. im a freshmen student ,takig up IMFORMATION TECHNOLOGY and i have a problem regarding how to make a calculator using SWITCH CASE, i've tried to make a program of that using other functions and it made it successfully but …

Member Avatar for xavier666
0
176
Member Avatar for charlie221133

hello, I'm a computer science student. I'm starting to get into the more challenging aspects of C++. Where can i find a good website for quickly finding syntax. Say i want to solve a simple problem, but i don't know the exact syntax, where can i quickly find code snippets …

Member Avatar for mrnutty
0
68
Member Avatar for lotrsimp12345

Do I need a copy constructor? [CODE] #ifndef MY_MIN_PQ_H #define MY_MIN_PQ_H #include <iostream> #include <vector> using namespace std; class my_min_pq { public: //default constructor my_min_pq(); //destructor ~my_min_pq(); //insert element at end of sequence, and rearrange so minimum data at the front of array void enqueue(int data ,int priority); //removes data …

Member Avatar for lotrsimp12345
0
124
Member Avatar for laelzio.mosca

I have this code for a tic tac toe game, it`s not done yet, and what I have done isn`t working like I want it to. The screan prints and promps player 1 and 2 for inputs one at a time, but my while loop in main is probably wrong, …

Member Avatar for jonsca
0
61
Member Avatar for sperrytx

I am a beginning c++ student and need to read in a text file as shown below: [code=text] Orvilles's Acres, 114.8 43801 Hoffman's Hills, 77.2 36229 Jiffy Quick Farm, 89.4 24812 Houston Bayou Texas Home Grown Popcorn Inc., 124.7 65687 [/code] The criteria is to read characters to comma then …

Member Avatar for Clinton Portis
0
291
Member Avatar for besbis cat

hey guyz how r u?? plzz i rly need ur help with this 1.. coz i dnt know how 2 writ it..:( Writ a program estimate how much a young worker will make before retiring age of 65. request the worker’s name, age, and starting salary as input. Assume the …

Member Avatar for wareagleau
-3
161
Member Avatar for guccitan88

I have to write a function to populate a 50 element integer array with random numbers: 100 <= # <= 1000. I have everything I need in the code except the "between 100 and 1000." The things I'm trying are not working. Thanks! [CODE] #include <iostream> #include <cstdlib> #include <ctime> …

Member Avatar for guccitan88
0
114
Member Avatar for ncwolfe

I'm using Visual Studio 2005. I tried to adapt the existing class for the binary search tree (from my book) to a template and mostly it works, but I'm getting errors related to the insertNode and deleteSubTree functions when I try to build it. The header file: [CODE] // Specification …

Member Avatar for ncwolfe
0
220
Member Avatar for cwarn23

Hi and I have just downloaded the Irrlicht gaming engine and although I have had a briefing about it from a friend I can't seem make it do what I want. I got the demo which is nearly what my result will look like but then I tried switching from …

Member Avatar for cwarn23
0
179
Member Avatar for lotrsimp12345

we are supposed to implement using STL vector and base it on priority and have have a data value So every time i enqueue i insert an in item into the end of the vector and if no space i modify. So do i reorder the list to place the …

0
65
Member Avatar for ItecKid

Hello all, I am trying to write a clustering algorithm where, given location of certain points (I.e, latitude and longitude) I need to choose 50 of these to be cluster centers such that the diameter of each cluster is minimized. To that end, I believe that the program should choose …

Member Avatar for ItecKid
0
111
Member Avatar for neumannj656

it builds correctly and runs correctly but when the program gets to the while statement, it just stops completely, does not even allow blind input of data. I know it is a little messy but here is the code: [code=c++]// buildingwillcost.cpp : Defines the entry point for the console application. …

Member Avatar for Evan M
0
156
Member Avatar for Veri7as

For some reason when i'm trying to declare a float function it gives me this error. But if i declare a void or any other type of function it works... any ideas? THANKS!! [CODE]#include <iostream> #include <cstring> #include <iomanip> using namespace std; void inputInfo(float *** rawScores, char names[ ][50], int …

Member Avatar for Veri7as
0
255
Member Avatar for PDB1982

I am trying to find a way to find a median of individual parallel arrays, but I'm not sure how to start. One question I have, though....is an array the same as a list? I was told that it might be easier to do a bubble sort of a list, …

Member Avatar for PDB1982
0
128
Member Avatar for Phloxicon

I have an alarmingly strange situation. I fill my map with const char * and int values. When I try to "find" the one I want, it says it's not there. Here's the short version: [code=c] // tempText = "socialize" for( actionIter =actionMap.begin(); actionIter !=actionMap.end(); ++actionIter ) { if ( …

Member Avatar for Phloxicon
0
118
Member Avatar for Talguy

So I can crop an image in cariomm and display it to the canvas, but what I want to do is crop the image and save the cropped image to a Cairo::ImageSurface so that I can paint just the section of the overall image to the screen with out have …

0
50
Member Avatar for jcax

I'm trying to move one big C++ string (with separators) like one below [CODE] & 12345 & 12345 & 23423 & 90323 & [/CODE] into 3x5 array like one below with the first group of numbers excluded char array[3][5]; [CODE] { '1' , '2' , '3' , '4' , '5'} …

Member Avatar for jcax
0
288
Member Avatar for kavourdoukos

I need help cause i dont know how to use an array of pointer to classes. I've got in my main this: [CODE]gramma** letter;[/CODE] I have in an other class named classA this: [CODE]gramma** grammata;[/CODE] I construct in my main like this: [CODE]letter=new gramma*[number]; for(int i=0;i<number;i++){ letter[i]=new gramma(arithmos,&array);}[/CODE] What i …

Member Avatar for Agni
0
98
Member Avatar for Dex02

Hello guys i need help, I need to write a program that count how many nubers can be divide in a interval from k to n, exemple in a interval from 1 - 10 theare "3" numbers that can be divide with 3, here is my program: 1. [CODE] #include …

Member Avatar for zobadof
-1
113
Member Avatar for zobadof

I have been getting tutorialed by somebody who also learns C++ and gave me the code to make a new window, but the CMD also opens with that. The fact that cmd opens with that is not the problem, the problem is I dont think I was ready to move …

Member Avatar for zobadof
0
86
Member Avatar for bonotevo

This is my first post so please bear with me. I am bringing in 2 files into 2 arrays and then trying co compare the arrays to each other. When I compare the arrays, I am trying to find out how many locations have matching letters in both strings. ) …

Member Avatar for Dave Sinkula
0
283
Member Avatar for matmeister

The problem: Palindromes are words or phrases that read the same backwards as forwards. Write a C++ program that indicates whether each line on an input file, called sentences.txt and given on my homepage, contains a palidrome. Those lines of sentences.txt that are palidromes should be written to an output …

Member Avatar for zobadof
1
303
Member Avatar for HunterFish

Good day to all. I would like to ask some help regarding C++ sounds. I read some codes in playing sounds using C++ and this codes was based on WINDOWS. I would like to as if there is a possibility that I can play a wav file in LINUX using …

Member Avatar for Stefano Mtangoo
0
277

The End.