General C++ Programming - April 2011 (Page 26)

Reversing an array using pointers
 
I am having trouble writing a reverse function using 2 pointers to reverse the values in the array. Here is my code. #include <iostream> using namespace st...
[6 replies] Last: wow easy fix. Thanks! (by ashworcp)
Need help with C++ programming work
 
Hi, I'm new to programming and I'm doing a course in uni. I'm currently using "Dev-C++". I've been away on holidays and haven't been able to grasp the work we'r...
[1 reply] : Please do not double post. http://cplusplus.com/forum/beginner/40535/ (by moorecm)
Mass Class Declaration
 
Hello all, I am new to C++ and have a question for everyone. I want to create a bunch of different object classes. For example, if I had an object called s...
[5 replies] Last: I got it figured out, thank you all very much! I appreciate it. (by bigggnick)
Why reverse iterators?
 
Why did the designers of the STL introduce reverse iterators? I don't need a reverse integer to iterate backwards over an array; so why do I need a reverse i...
[8 replies] Last: I think it makes a bit more sense to give the container reverse iterat... (by Galik)
by rutski
Virtual Inheritance (Space & Performance)
 
Is there any space or performance overhead incurred in using virtual inheritance? Regardless of how small the overheads might be, I'm curious to learn about the...
[4 replies] Last: According to effective c++ third edition--item 40 virtual inheritance ... (by stereoMatching)
need help with passing an array in a recursive (merge sort) function
 
my assignment is to get a function to merge sort data. we can use either arrays or linked lists as our data structure, and i picked arrays. here is my function:...
[6 replies] Last: finally got it! got rid of all the *'s and &'s and it ran but didn't w... (by pacman529)
by idk
File I/O help needed
 
This program below returns -1 everytime. However, it should retun 5 as the file "Hello.txt" has the word "Hello" which has length 5. #include<iostream> #i...
[1 reply] : You asked for 10 characters from the file stream which only contained ... (by Galik)
by bzd60
inheritance in c++
 
Dear all, How can be possible to inherit only one member function from base class in a derived class? Thanks, Behzad
[2 replies] Last: make base class members all private. inherit base class and into deriv... (by sasanet)
Merge Sort algorithm
 
Hi! What could be the best algorithm for "Merge Sort" where the memory must be used "most effectively"? I just know the standard way to do this, but that's not ...
[3 replies] Last: you have the basic idea down. doing it your way, you are storing 34*2 ... (by pacman529)
Recursion-Finding how many times digit six appears in two digit random numbers
 
I need to make use of recursion, in finding how many times the digit six appears in random numbers that are two digits, so from 10 up to 99 and then i need to p...
[6 replies] Last: //so if the function will print only, void is fine. I'm writing thi... (by Mathhead200)
by yunru
Returning a string array
 
I have a class BookType and it has authors in an array(4 maximum) how can i set the authors and return the array to print it out? class BookType{ publi...
[2 replies] Last: Thank you so much for your time, i did not include all variables and m... (by yunru)
Creating an Age Calculator
 
I am a beginner in C++ programming. I was trying to make an Age Calculator. It works on the basis that the user will enter the date, his birth year, birt...
[7 replies] Last: You could do this more simply by converting the calender dates to Juli... (by buffbill)
Stuck on a C++ code problem
 
free
[3 replies] Last: Problem 1)How much data are you able to write to "height.txt"? Problem... (by buffbill)
stacks
 
Im not sure how to write this segment of code. My goal here is to ask user for a file name, then read in the file one character at a time into a stack class ref...
[7 replies] Last: So I've taken what i've learned from all that and revised this section... (by camouser)
by RDJ
C++ Char input
 
Hello, I coded a text-based game for school, and its about the Bill Of Rights. Anyway, when the user inputs the amendment number (1-10), based on the given se...
[no replies]
Add an external exe file to my C++ program
 
Hi I have a program1 which is like this and created as test.exe #include <windows.h> using namespace std; int public(int argc, char *argv ); { system("pi...
[2 replies] Last: I am using dev c++ how to do the above with this (by bijayswain)
Hash Tables: Insert and find function
 
Quick question: How do I insert the key-value pair into my hash table? void HashTable::insert(string key, string value){ } Thank you.
[5 replies] Last: If its chaining, how do I work with the collisions? Do I need to use a... (by hydride)
MonthlyAnalysis Prog - Array errors
 
// Monthly Sales Analysis #include <iostream> #include <iomanip> using namespace std; // Function Prototypes void inputData(double ); int lowMonth(do...
[2 replies] Last: Any help anyone? (by diaz994)
by deztox
Function with string parameter
 
I'm tring to make a small program that checks for a file and if it doesn't find it, send the name of the file to a function that'll make the file with a line of...
[2 replies] Last: Don't put the name of your variable in quotes. (by firedraco)
implement the strncpy function
 
How do you implement the strncpy function of the standard library?
[4 replies] Last: Ok so if you had some sample input say: char strA = "Hello."; //{... (by Mathhead200)
April 2011 Pages: 1... 2425262728... 37
  Archived months: [mar2011] [may2011]

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