Beginners - November 2012 (Page 38)

Copying one dynamic array into another and using "delete"
 
Here's what I have so far. #include <iostream> #include <iomanip> using namespace std; void main() { int * listDyn; int max =2; int n=0; int...
[2 replies] Last: I knew it would something so simple. Thanks! Sorry about the indentat... (by bigmeatyclaws)
ifstream problem
 
Hi, I'm having some trouble with a couple of ifstreams. I need to read in two files, and so I basically repeat a piece of code that I know works. However, for...
[2 replies] Last: and a couple lines from the data file. (by SamuelAdams)
Populate an array with random ints
 
This is where I am at so far: #include <iostream> #include <cstdlib> #include <ctime> #define SIZE 3 using namespace std; /* Create a 3x3x3 array of...
[14 replies] Last: I don't understand how the array is populated before you get to the ... (by cire)
iteration, nested loops. I must be missing something.
 
I'm currently doing a beginners course in c++. They've asked me to write a program that asks the user for any number of lines and then writes it according to th...
[3 replies] Last: you can try do while loop do { //things you want to do }while(n!=0);... (by ViperTok)
Small problem for vector . help !
 
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <conio.h> using namespace std; class Books{ private: strin...
[5 replies] Last: That certainly meets the requirements. Great job! (by Thumper)
Difference between aggregation relationship and the composition relationship?
 
If anyone could please explain to me in a simple way the difference between aggregation relationship and composition relationship....i am lost on this...please ...
[1 reply] : To start with, have you checked out the relevant Wikipedia article(s)?... (by andywestken)
convert string to char*
 
I have part of my code that i do not know how to solve the error. my input in the file is something like. age, (4, years, 5, months) age, (8, years, 7, months...
[6 replies] Last: char * point; ifstream file; file.open(file.c_str()); if(file.is_open... (by ViperTok)
help for my quiz
 
Question: create a program which counts negative and positive integers entered by the user. program will ask how many numbers the user will enter. In every ste...
[1 reply] : Perhaps you could share some code for the assignment you've already wo... (by Thumper)
Help with increasing vector by user input
 
Here's my program so far: #include <iostream> #include <vector> #include <string> using namespace std; int main() { vector<string>favGames(5); string userI...
[3 replies] Last: Thanks guys, I forget to mention that I did know and try about push_ba... (by DJLad16)
Student Report Card Project
 
Hi guys! I have made this "Student-report Card Project" in C++ for my project in school. The Program works completely fine and has no errors in it. But I do ...
[1 reply] : // HEADER FILE USED IN PROJECT #include<fstream.h... (by absawis)
Help with vector input
 
I'm wanting to create a program where the user can enter 5 of their favourite games, I have a general idea on how I will code this, and I've created this vector...
[2 replies] Last: Thanks for the help :D (by DJLad16)
a function-definition is not allowed here before '{' token
 
Hi all, I have this code: #include <iostream> #define func( returnType, name, params, body ) { \ returnType name params { \ body; \ ...
[3 replies] Last: You can't put the function definition inside another function ( main(... (by Fransje)
const object
 
Hi! Well im writing a program where in every object has a name,latitude and longitude assigned to it and im writing this function to calculate which city is cl...
[2 replies] Last: Thank you! It works now. (by noisycoder)
Problem casting derived class pointer to base class pointer
 
Dear All, I have basically the following situation: int main(int argc char* argv ) { // vectors that will contain pointers to BaseBox objects vect...
[8 replies] Last: Thank you very much guys, you nailed the problem! Cheers, Little (by littleneutrino)
Need a way to make the comupter think keys are being pressed
 
Again there must be some simple function that i'm looking for that i just can't seem to find, i know someone must have an idea of how to imitate key presses on ...
[7 replies] Last: *bump* (by TheBeardedQuack)
Construction enigma
 
Hello there, I got a problem with constructors. Until now I thought, that the expression 'Object o = value' is equivalent to 'Object o(value)', but now I doubt...
[5 replies] Last: If I add a user defined Constructor, the Compiler should not generate... (by Cubbi)
undefined reference to 'nama_class::nama_class'
 
I was using pascal to learn programming, and I am extremely noob with c++, as I tried to figure out how does the class be placed in separated file on c++, I tri...
[2 replies] Last: you're right, I didn't include them as one project. I thought by putti... (by Aksan Akmal)
by am0n
Need help doing simple project
 
Hello, I need to write a code that will display every odd number from 1 to 20. How do I do it? Thank you.
[2 replies] Last: for(int i = 0; i<...; ++i) { int odd = i * 2 +1; } you will fi... (by Darkmaster)
by Moth
'friend' functions not accessing private members
 
We're learning about friend functions and vectors, the ladder I seem to of nailed on the first go. But, now I can't get my friend functions to access private m...
[7 replies] Last: So basically, what's the best way to print the nth element of a vecto... (by coder777)
Checking for Invalid Binary Inputs
 
I'm having a problem checking for invalid binary inputs from the user. Here is the program. Can anyone tell me how to approach this? These are the errors I'm g...
[2 replies] Last: #include<iostream> #include<string> using namespace std; void binTo... (by Chervil)
November 2012 Pages: 1... 3637383940... 75
  Archived months: [oct2012] [dec2012]

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