General C++ Programming - November 2012 (Page 31)

Parallel Array and an Input Text File
 
I have a text file for my input and I need to store this information into two arrays. The data in the file is organized in columns of "ID's" and "Wages" like so...
[1 reply] : Okay, so I've made a rookie mistake. I've gone back and simplified som... (by camarowheels)
Help with C++ problem
 
For this assignment, write a program that will place city temperature information into an array of structures and then calculate some statistics. The structure...
[2 replies] Last: lol a little late to be starting this assignment (by Cody0023)
Array Help
 
These arrays are kicking my butt. Can someone help me with what i have so far? int getGrades(float grades , int num) { for(int i = 0; i <= num; i++) {...
[6 replies] Last: Thank you! it is now working. I need to stop flipping the operands. Th... (by mckizzlealmond)
by iky
need help with calling function twice?
 
i have to call the aretheysame function twice, once before the roundscore function and once after it. they have to print out different things when called. t...
[4 replies] Last: thank you so much!!!! (by iky)
Simple Emulator
 
I want to start to create a simple emulator - a gamebody advance emulator Honestly, my skillset probably wont allow me to ever actually finish this project - ...
[no replies]
How i can convert string to wchar_t ?
 
I want to convert my string to whcar_t. I try this code but i can't success :S string username="UserName"; wstring widestr = wstring(username.begin(), userna...
[4 replies] Last: If your C++ compiler supports C99 features, you can do one without the... (by vince1027)
by Prog24
Changing the input of my program
 
I wrote this program which converts a time from 24 hour notation to 12 hour notation but I need to change it so it reads in the times one line at a time from a ...
[no replies]
Loading Issues
 
Ok guys I'm having a loading issue... I'm making a Text Based RPG and i want people to have 2 worded names and or town names this will help with my loading ite...
[2 replies] Last: cout << "Enter you character's name: "; cin.ignore(100,'\n'); getlin... (by bobthedruid)
by DaveJC
Bugging Pointers
 
So I have this object, a Node, that has pointers (left_, right_)to other nodes. I also have this code that takes the "smallest" 2 nodes from a heap and combines...
[1 reply] : Went with a different way of declaring these: while (heap.size() > ... (by DaveJC)
C++ Arrays:invalid conversion from int to int*?
 
Writing a programs that get integers from a file, reads to arrays, sorts the arrays in ascending order and outputs it. But im having trouble with the sorting fu...
[1 reply] : I did not see all your code because it will be enough to point out tha... (by vlad from moscow)
Debugging ifstream
 
I am debugging a function and as usual I always dump the memory to check if the address of a variable that I used actually contains the correct data. Anyway...
[3 replies] Last: You just prove to me that you could tie the two together. Yes, by as... (by Cubbi)
by aslv
compiler settings through source code
 
Hello! I would like to ask how to change compiler settings throught the source code. Especially, I want to make a online contest system to compile my source usi...
[2 replies] Last: Since this is competition software, there should be a way to set the c... (by LB)
Iterators skipping characters
 
I want to reverse the cases of the letters in a text file. The code below doesn't work for me. Any ideas for fixing it, or for another approach? Thanks. ...
[4 replies] Last: Thank you for the replies. gustgulkan is right, and the underlying r... (by Catfish2)
inheritance ctors
 
// see main() #include <iostream> #include<string> using namespace std; class x { public: x() { a++; } private: static int a...
[2 replies] Last: How should i solve thos problem virtual keywords global varibles (by aclark17)
decrementing an iterator from begin
 
Does anyone know if the C++ language specification defines the behavior of a bi-directional iterator that is decremented to the position before begin()? Is the...
[4 replies] Last: ne555, Yes, I think I understand the advantages and ramifications of ... (by mtbusche)
I can't seem to find how to achieve this with fstream
 
I am trying to open a file that the user specifies and then read from that file. Here is my code. I cannot seem to get fstream to work with the cin file name. ...
[17 replies] Last: Its likely an issue where the program tries to find the path or file r... (by BrokenSilenceDev)
by Nausea
Inheritance problem
 
Hey So I got a entity base class and then a projectile class that inherits the entity class. Now I got this problem that the entity class has a OnLoad functi...
[4 replies] Last: Thanks L B, I will try to figure out how to do that. That was nice, no... (by Nausea)
Array-like variable format
 
Hey everyone, is there any way to ensure that variables declared in this format: int a; int b; int c; int d; would be accessible with a pointer like this: (&...
[6 replies] Last: Ok, thank you. (by BrokenSilenceDev)
Issue With Two Dimension Variable Array/vector
 
So, I have a program where size of the multidimension array is based on the value that comes from a file. I want to pass this array to the function so that it p...
[4 replies] Last: I am not sure if that worked, I still get the error at the class when ... (by DeerPark)
How can I return the highest and second highest scores in this C++ program?
 
Define a getTopTwoScores() function with the specification and prototype shown below: // Set highest to the score with highest value and secondHighest to the ...
[7 replies] Last: I modified my code, but I don't know if I am getting any closer. voi... (by andy2012)
November 2012 Pages: 1... 2930313233... 51
  Archived months: [oct2012] [dec2012]

This is an archived page. To post a new message, go to the current page.