Beginners - April 2015 (Page 29)

Multidemisional arrays
 
Hello, I have a write a 5x5 two dimensional array. In which i enter values for the first column and row using for loops to prompt the me to enter the values. ...
[1 reply] : 5x5 matrix: array = {0, 1, 2, 3, 4} array = {0, 1, 2, 3, 4} array ... (by Smac89)
int& question
 
I'm not sure if I understand this properly and can't find it anywhere. void cat (int a, int b, int& c) int main () { int w = 1; int x = 2; int y...
[1 reply] : This is called pass-by-reference and it is the same as if you had done... (by Smac89)
First software
 
Hey all, Ive been learning C++ for awhile now and Im interested in building my own applications/ software that I can use on a daily basis. I have a workout r...
[7 replies] Last: What I don't know is how to store the input permanently and how to cre... (by specter113)
Print parent path?
 
Hello, My question for today is, why can't I print parent path when I run my program in command prompt. If I run my program in my IDE under debug or release th...
[2 replies] Last: It's part of the #include <filesystem> library, using namespace std::t... (by xXBurnt)
Program crashes while reading data from file into array
 
Dear all, I'm trying to read information from .txt-files into arrays in C++ do use them for some numerics. I have eight two dimensional arrays and everything...
[4 replies] Last: Thank you a lot for your answer. Once I used dynamic memory allocation... (by jockoflocko)
Nested loop
 
My nested loop doesn't stop. When I enter the price of the small pizza the loop goes to infinite. #include <iostream> #include <cstdarg> #include <iom...
[1 reply] : Your indentation is incorrect so your loops don't make sense. Fix the ... (by LB)
Begginers Questions/Interview
 
Hello everyone, As you know we are in the Begginer's Area, so questions with this subject can be normal for almost the recent programmers in C++ and, as we'r...
[2 replies] Last: 4: Boost http://www.boost.org/ (by LB)
Passing an object into another class
 
Hi, If I have a class called Class1: With an object say Class1 _object; And that object has data in it that I need in Class2 How do I go about ...
[1 reply] : class Class1; class Class2 { Class2(Class1& c1) { .. } }; class... (by Smac89)
C++ Comment Convention
 
Hello, This might be a dumb question, but I am looking at some c++ example code and am seeing a comment convention I do not understand. Maybe it is only use...
[2 replies] Last: It's probably used by some tool. Doxygen uses //! but it doesn't look ... (by Peter87)
Looping through a vector of vectors c++
 
Hi, I am working on a project that docks ships within 3 docks and each dock has 10 rows and row has 5 smallBerths, 3 medium, 2 large. I am trying to get...
[2 replies] Last: You mean on this line? _smallBerths.push_back(ship); (by PapaSmurf)
Dividing Different Data Types
 
Here, the denominator of the expression is type cast, ensuring the radius will be of type double. Does the denominator always determine the type of the result o...
[1 reply] : #include <iostream> template <typename T> const char* typeof(T&) { r... (by Smac89)
Illegal use of this type as an expression?
 
Hi, I am trying to use a function which I have declared in dock class which takes the parameters (Ship &ship) if (readinsize == 1) { ship->_s...
[5 replies] Last: What gabars said fixed the issue thank you. (by PapaSmurf)
function not returning true false,how to cout index of array
 
c) Which searches the first n elements of an array for an element with a given value. If the value is found then the function should return true and also return...
[2 replies] Last: try this ... cout << "Value returned by the function is : " << isSam... (by digital D)
by ry0823
help with void printpattern
 
Hello, I've been having problems with my program. My goal is to have the user enter a pattern type and pattern size and then it will print dollar signs using a ...
[5 replies] Last: Thanks LB! I got it to work! (by ry0823)
kitten population calculation error
 
Need help with this code ::: the answer i am getting at the end does not match the expected answer .... At the start there are 1 male and 2 females kitten 2 mon...
[5 replies] Last: You made some mistakes trying to follow what I gave you. for (/* ag... (by fg109)
Quaternion operations
 
I want to preface by saying this is homework but any general advice is appreciated. I'm trying to write a program (a .cpp file and a header file) that when when...
[5 replies] Last: If I could be more specific id say the problem is trying to find out ... (by fg109)
by s8050
how to make a limited time for an input function?
 
Hi guys! I need a way to make a limited time for the cin such that the user should have a limited time to enter something. if the user entered something in th...
[5 replies] Last: My friend, He is just simply asking if you program on Windows, or Linu... (by TarikNeaj)
Why do some people not use namespace std?
 
Wouldn't it just be easier if you put using namespace std; at the top of your program? Some people however dont choose to do that and I was wondering if there i...
[1 reply] : Read here - http://stackoverflow.com/questions/1452721/why-is-using-... (by TarikNeaj)
Studentlist
 
Write your question here. #include <iostream> #include <string> #include <iomanip> #include <cstdlib> using namespace std; struct student { string fNa...
[1 reply] : Ok. I was abel to fix it by my self. i think its without bugs. But ple... (by Vitalik2)
working with arrays and functions
 
I am working on a program that i have to create an out put of 20 lines generating 20 random numbers and on each line track what the biggest number was and how ...
[1 reply] : the output should look like this: 1: 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5... (by marcusg)
April 2015 Pages: 1... 2728293031... 52
  Archived months: [mar2015] [may2015]

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