49,761 Topics

Member Avatar for
Member Avatar for mchin131

I have this assignment where I'm supposed to read in a text file and assign the values to a vector and sort them out. The text file has values for country, population, birth rate, and death rate. An example is: (not realistic numbers) USA 400000 5400 3200 Canada 56000 3400 …

Member Avatar for gerard4143
0
65
Member Avatar for ana_1234

I have a problem I'm not sure where the error is occurring. I think it's when I used cin.ignore in my code. My problem is occurring in case A. For some reason the program stops right after I enter my price information. I tried doing small codes to figure where …

Member Avatar for Greywolf333
0
168
Member Avatar for cosnersx

There is a sample program in my C++ book that uses the += operator, and doesn't explain how it works: [CODE]gold += silver / SILVERPERGOLD;[/CODE] What exactly does this mean?

Member Avatar for Greywolf333
0
70
Member Avatar for xiansen

Hi guys, below is what i have so far and I am having trouble outputting the players' data in descending order. For some reason, my output is in ascending order. Also, I need to check if the user enters a player number that has already been used, and then prompt …

0
76
Member Avatar for rpdm

How can this BST class be better? [code] #include <iostream> #include <iomanip> #include <stdlib.h> #include <time.h> #include <conio.h> using namespace std; template <class KeyType, class ValueType> class BST { public: BST(): mroot(0), mcount(0) {} BST(BST const& tree) { *this = clone(tree.mroot); } BST& operator=(BST const& tree) { if (this != …

Member Avatar for alwaysLearning0
-1
111
Member Avatar for aaronmk2

I am pretty sure that the answer for this is n^3, because the 3rd for loop is executed n times and the middle is executed n+4 times and the top one is executed n times. I understand how to use sigma notation for the bottom and top for loop because …

Member Avatar for mrnutty
0
143
Member Avatar for Nathaniel10

An exercise in Stroupstrup's book is to write a program involving memory allocation with an infinite loop and let it run until it crashes. He says the crash will be due to [i]memory exhaustion[/i]. He also suggests researching the topic. I did and am frightened by what I found. The …

Member Avatar for Nathaniel10
0
1K
Member Avatar for Beancounter5

Hello , sometime ago I started a small project centred around some crazy mutating breeding rabbits( sounds silly but I have learned an awful lot ,especially about lists). Anyway , as each year passes the number of rabbits grow - not exponentially but very quickly all the same. The next …

Member Avatar for mike_2000_17
0
100
Member Avatar for L.sha

The question is to - Suppose you have a main() with three local arrays, all the same size but type (say float). The first two are already initialized to values. Write a function called addarrays() that accepts the address of three arrays as arguments add them and put their sum …

Member Avatar for Intrade
0
2K
Member Avatar for Vllinator

I need to return the numbers of the lotto ticket to main, then call a print() to print the numbers. But the ticketGenerator only returns 1 number. Please help [code] #include <iostream> #include <ctime> using namespace std; int ticketGenerator(int); void printTicket(int,int); int main() { int size; int numbers; cout << …

Member Avatar for sid78669
0
110
Member Avatar for jae5086

Ok, I am having two issues with this program, and since I am new to the forum, yes, I am a beginner so I am sure the error is so common it makes you want to cry seeing it again, haha. Anyway, the program is supposed to keep working with …

Member Avatar for jae5086
0
105
Member Avatar for Software guy

Hi, I have been working on this small console applications for 2-3 days now but I cannot find the problem. The Task is that I have to read a file which has sentences in english and I just have to get the frequency for each character and print it out …

Member Avatar for Software guy
0
124
Member Avatar for sahil1991

hi friends, i was doing functions and i encountered this thing that automatic variables are stored as stacks and static,global as heaps.I am in a bit confusion about these terms......can someone help me out...plz

Member Avatar for mike_2000_17
0
141
Member Avatar for ekailan

I have this tow errors ,how I can solve it.any ideas? error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRTD.lib AC fatal error LNK1120: 1 unresolved externals Debug\AC.exe AC

Member Avatar for ekailan
0
128
Member Avatar for hveed

hi, I am new to programming and looking for some help, here is the portion of the assignment that is giving me headaches: using one function, upload (i.e., input) the integer value and the color text, ignoring the word "Color:"; the function must only upload one data pair (i.e., the …

Member Avatar for Ancient Dragon
0
136
Member Avatar for DarkSatan

I just found this tough question in the last year Q Paper of this competition...1st how can I take inputs in a single line??(noob question) 2nd Can any1 help me with the logic to use...If u cud write a small eg. prog I would be greatly thankful NOTE:I had also …

Member Avatar for DarkSatan
0
125
Member Avatar for Morbane

Hi, I have been trying to use a struct to hold some const chars that represent a fixed date The idea is to select a date on a Month Calendar and compare it to the fixed date in the struct so that a MessageBox can show [code] typedef struct BASEFULL …

Member Avatar for comeugive
0
232
Member Avatar for Spinz

Hi! I am a beginner in C++, I hope that anyone can advice me on approaching this problem. I would like to implement a class graph that uses breath-first search in order to remove a chosen vertice as well as its corresponding edges. I want to: *add or remove edges …

Member Avatar for alwaysLearning0
0
72
Member Avatar for DarkSatan

I just found this tough question in the last year Q Paper of this exam...I dont know how to take that type of input,leave alone the logic...Can any1 help me with this program, plz... : [B] Question 1 Vogon zoo On the icy planet Zorg, the Vogons are putting together …

Member Avatar for csurfer
0
320
Member Avatar for aladar04

Hi! I am having trouble with this program. I'm done with the creation of records. My problem is, I cant make it print a record using the Record Number inputted by the user. I used seekg() but it doesn't work. I have attached the files for reference. try.cpp and accounts.txt …

Member Avatar for alwaysLearning0
0
107
Member Avatar for DrueY

What do the numbers tell me, in terms of frequency, amplitude and maybe time? Thank you muchly! drue

Member Avatar for DrueY
0
478
Member Avatar for Alexkid

Hi there, Can anyone tell me how to change my win32 programs icon (top left). I'm running MSV C++ Express 2010, so i don't have MFC. Theres a few tutorials on how to do this but using resource files? Which apparently MSV doesn't support. I want to be able to …

Member Avatar for Alexkid
0
315
Member Avatar for cortez716

Okay here's what I'm trying to do use a for loop get 5 numbers from input ONE number at a time. Output the sum and average of the 5 numbers. I am only allowed to use a maximum of 2 variables to solve this problem. Heres my code so far, …

Member Avatar for WaltP
0
152
Member Avatar for ysmelik

I Try to make program Audio Recorder from LIne In / Microphone using C++ Builder. I get 2 Error message : 1. E2171 Body has already been defined for function '_fastcall TForm1::~TForm1()' 2. E2188 Expression Syntax Can somebody help me to finishing this problem ? Here my Simple program : …

0
74
Member Avatar for crazylunatic

I have a VS project which is compiled using the unicode character set. I load a dll using LoadLibrary and that dll is also built using the unicode character set. I use a method exposed by the dll which returns me a std::string. I am having some trouble with converting …

Member Avatar for crazylunatic
0
717
Member Avatar for kirennian

I'm currently having an issue with moving the camera around the z-axis (roll). For debugging purposes, I have an object with which I've tested with all 3-axis rotation and movement and it's working as expected; the object in question as well as the camera class superseed a positions class for …

Member Avatar for dineshguru
0
1K
Member Avatar for burcin erek

1>------ Build started: Project: allegro, Configuration: Release Win32 ------ 1> allegro.cpp 1>MSVCRT.lib(crtexe.obj) : error LNK2001: unresolved external symbol _main 1>c:\users\lenovo\documents\visual studio 2010\Projects\allegro\Release\allegro.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Member Avatar for burcin erek
0
109
Member Avatar for aviavyne

Hello, I started C++ and I have a trouble with this thing. I can't make it work. What I am trying to do is to get the value and calculate the area of a circle using a class type of coding style. Note that this does not even compile. "Where …

Member Avatar for Unimportant
0
108
Member Avatar for waynew

I readily admit that I am not a heavy developer, otw I probably wouldn't have this problem, but here it is. I cannot get openssl to compile under Windows. Mingw/msys is installed ok. Downloaded then unpacked openssl under my mingw home dir. So far ok. cd to openssl-1.0.0a Executed ./config …

Member Avatar for Ancient Dragon
0
117
Member Avatar for Anuradha Mandal
Member Avatar for Ancient Dragon
0
68

The End.