Beginners - April 2012 (Page 15)

vector merge sort
 
template <class T> void sort(T s, T e) { unsigned int m = (s + e)/2; if(m - s >= 2) { sort(s, m); } if(e - m >= 2 ) { sort( m+1, e ); } ...
[4 replies] Last: Thanks for the suggestion! (by kornunknown13)
Division by subtracting recursively
 
I just started doing recursion in my C++ class today and I'm starting to get the hang of it. I've already written a function that multiplies two numbers by rec...
[6 replies] Last: No problem. This is a good way to understand recursive functions. Of c... (by Vlykarye)
Drink machine simulator initializing from txt file issue
 
I am trying to create a drink machine simulator that reads from a text file called "DrinkMachineInventory.txt" for the input. The text file must contain the...
[7 replies] Last: weird, my guess is getline only reads in strings then. Another method ... (by Need4Sleep)
I don't know how to do this c++ code dealing with opening files and editing them.
 
Create a text file containing the following data (without the headings): Name Social Security Number Hourly Rate Hours Worked B Ca...
[9 replies] Last: Thank you very much. (by jose2529)
converting Char with ASCII
 
so i converted a letter to int using ASCII via (int=char) my example is in my menu() void LList::Menu(){ //This displays the vigesimal number that ...
[no replies]
Pointers and the BubbleSort
 
I am getting an error when I use a pointer in part of my bubble sort. Can anyone help? The error occurs on lines 122 & 123 at the first open parentheses. It say...
[1 reply] : sorting objects is different than sorting single data types. ill use a... (by ui uiho)
Project pointers
 
I am relatively new to C++. I am trying to use a text file with a list of addresses formatted as such, "100 Smith St". I want to search the list of addresses ...
[1 reply] : something along: while(textfile >> string){ if(string == "Smith"){ s... (by Need4Sleep)
Compiling Error Simple Math Program (C++ Primer)
 
#include <iostream> using std::cout; main() { int value = 2; int pow = 2; int res; cout << value << " raised to the power of " << pow << ": ...
[3 replies] Last: Although it is indeed a highly recommended book, I don't think anyone ... (by Cubbi)
Find line number of a word in a txt file
 
#include <iostream> #include <string> #include <fstream> using namespace std; int main(int argc, char *argv ) { int counter=0; string word; i...
[1 reply] : #include <iostream> #include <string> #include <fstream> #include <i... (by MetalLord85)
Help-my code reads small files but not large
 
Hello, I'm trying to make part of a code that reads a csv file with data containing the date and time, and the wind speed at that time, then does various output...
[1 reply] : Does it miss every second date and time part out from the start of the... (by vin)
showpos output issue
 
I am trying to output numbers in an array called memory in this format: +0005 (given that that location in the array holds the integer 5). My output is bas...
[4 replies] Last: You need to add the I/O manipulator std::internal or its equivalent.... (by Cubbi)
Segmentation Fault
 
I have looked at this for a long time and cannot make it work. After the menu selection, 1, 2, 3, and 5, give me a seg fault. Please help! #include<iostr...
[no replies]
Need confirmation :) - Guessing Game
 
Hello, so, i've got this exercise from this Beginning C++ Game Programming that i got, a Guessing game, im supposed to create a game where the user inputs a num...
[14 replies] Last: If you really want to make it interesting, then try this. #include <... (by GRex2595)
Functions using Struct?
 
Hello guys, im quite desperate trying to bring this to work. I have to write this function which transfers the numbers from karthesian to polar-Coordinates a...
[2 replies] Last: You are the master of all c++. Now it works! Thank you so much. I wo... (by prophe7)
Finding the sum, average, large, and small number in a eof?
 
The file needs to find the sum, average, smallest, and largest number within the text file. Any help is greatly appreciated. Thank you. #include<iostream> ...
[no replies]
by ludden
Include multiple classes
 
Hi, I would like to include multiple classes into my project. I'm using Eclipse IDE on Linux to compile and link. I'm just too stupid to search for the right...
[no replies]
error: declaration of ‘team’ as array of references
 
I'm working on a program for class, and I almost have it. I just have one more error that I haven't been able to fix. I'm getting the above error in line 42, an...
[2 replies] Last: I've got it now. Thank you! (by EricaFH)
by thom
install new library, here Qwt
 
Hello, Some time ago that I had managed to install the library qwt on windows but now I've tried stuff and I can not do it .... Here are the steps I have made...
[no replies]
Non Repeating number generator
 
Hi I have put up my code now and apologies for not doing it earlier, I was using a different computer and browser over the weekend, didnt have the compiler etc....
[6 replies] Last: Here is a compiled example const size_t N = 20; std::bitset<N> b; ... (by vlad from moscow)
best structure for this struct to save memory?
 
I have a struct like struct foo1{ char* stuff1; char* stuff2; char* stuff3; char* stuff4; }; but its taking up a bit of memory when i have a full array t...
[4 replies] Last: [quote=cantide5ga] "Is the increase in processing worth the compacting... (by closed account zb0S216C)
April 2012 Pages: 1... 1314151617... 66
  Archived months: [mar2012] [may2012]

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