General C++ Programming - May 2012 (Page 41)

Help with Program
 
I am making a GUI program in Visual Studio C++ 2008. I have an image file that may help out in solving this dilemma. I also have code to supplement this as we...
[no replies]
by mx760
c++ vectors vs dynammically allocated arrays
 
What's the pros/cons b/t the two.
[3 replies] Last: Yea, I used Vectors for my Sieve of Eratosthenes prime generator progr... (by Whovian)
Can someone tell me what's wrong with my prgoram :(
 
#include <iostream> #include <iomanip> using namespace std; int main() { int account_number; int minutes; char service; doubl...
[10 replies] Last: except not maths.h, math.h (by Echo773)
Can someone tell me why this wont work?
 
This code is designed to let users create their own estimates for pricing and for some reason, the grandTotal function doesn't work right, any thoughts?? #...
[11 replies] Last: solved changed grandTotal == to = (by Echo773)
by codder
Extract keys from a string
 
Hello, Supposing to have this string: std::string str = "Func(123.6,6565.3,342.2,76.04)" How can I extract single values from it and put them in single float ...
[1 reply] : This is by no means a finished solution, but this is more than enough ... (by clanmjc)
the number of vowels (a,e,o) in the off diagonal of the array
 
This question is mainly based on Block II – Unit 1 and it tests your ability to work with arrays. Consider a 5-by-5 array of characters. Write a C++ program ...
[2 replies] Last: yes (by enigmaticady)
by julng
sorting using strcmp alphabetically
 
Hi guys, I am stuck in sorting the string list. THe output i want is to sort the strings alphabetically. Can someone help me? void sortingWord (list <s...
[9 replies] Last: > I am stuck in sorting the string list. Why can't you just use std... (by JLBorges)
Sorting Algorithms Query
 
Is there a way we can directly use sorting algorithms in our programs? STL has sort() function which, I guess, internally implements a combination of introsort...
[5 replies] Last: The standard algorithms library has std::sort() and std::stable_sor... (by JLBorges)
Enumerations: Where to declare them?
 
Hello! I am yet another one of those fools who is trying to learn enough C++ in there spare time to someday get a job in Game AI :P To start this challenge I...
[2 replies] Last: Thats brilliant! Thank you very much cire! (by Swizzler)
diamond problem - or not
 
Hello all, I have been thinking about this and I think I need some help. I have the following situation: I'm working on a project that involves using a bunch o...
[5 replies] Last: @clanmjc: Yes, that is my current hierarchy. I also thought about this... (by Agent Smith)
by Mannah
Classes with overloading operators
 
#ifndef matrix_h #define matrix_h #include <iostream> using namespace std; class Matrix { friend ostream& operator<<(ostream output&, const Matrix&)...
[2 replies] Last: The code as given does not compile - there are quie a few syntax erro... (by guestgulkan)
Loop will not stop?
 
My break; isn't ending the for statement. User should only get 3 choices but they get to input more than 3 times. Please let me know what i can do to fix this. ...
[1 reply] : The loop only iterates 3 times. It may seem like more if you call the... (by cire)
by mx760
dynamically allocated single vars/arrays
 
Hi, I am confused as why there are two ways to dynamically alllocate memory: int size = 12; int *anArray = new int ; anArray = 7; delete anArray; versus...
[3 replies] Last: As noted: undefined behavior: anything at all may happen, now or lat... (by cire)
Problem with 'switch'
 
I am currently writing a simple program for my C++ class. It's almost done, but I'm having some trouble with my switch function that I'm using for a user menu. ...
[13 replies] Last: You might change line 66 to studentInfo.open("studentInfo.dat", ios... (by cire)
I am so close! ( i think....)
 
Hey everyone! I am working on a project and I am sooo close, or so I think, to being done. I am having trouble with one section of this program. when it runs...
[2 replies] Last: You just needed to calculate the four different values and save them. ... (by histrungalot)
Initializing size of hash table
 
If I know how many items are going to need to go in my hash table, how could I initialize it to a size that keeps the ratio of number of items to number of tota...
[1 reply] : Multiply the maximum expected number of elements by 1.5, and then roun... (by JLBorges)
Out of range at memory location
 
I have to read in two names from a text file and change each letter to its corresponding number value and multiply all the numbers in the string. If that number...
[6 replies] Last: Never mind, I fixed it. I also made it more efficient. Instead of repl... (by rasen58)
Help creating this algorithm please?
 
I'm working on a hash function that gives a given string an "ID" by mapping that string to a key. The algorithm I need to use is described below: Given the ...
[1 reply] : The first trick is to notice that you are doing the same thing over an... (by Duthomhas)
Populating Files in a Combo Box
 
I am a beginner. I have a 5 files that is saved on my C drive in a folder. I need to use MFC c++ and create a Combo Box . When the program is running the files...
[no replies]
May 2012 Pages: 1... 394041
  Archived months: [apr2012] [jun2012]

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