Beginners - October 2015 (Page 28)

by Opaul
Write a program that outputs the total of 5-digit numbers with a five in them, but not with an 8
 
My challenge is to output the total number of five-digit numbers that have a digit 5, but no digits 8. My only two answers so far have been 0, or 90000. Can any...
[2 replies] Last: If zero is allowed as the leading digit of the five digit number (ie. ... (by JLBorges)
by krappy
insert element into nested vector
 
Hello, I am very beginner in c++ and has been doing some things. I have faced a problem where i want to add a element inside the nested vector. Ill post my code...
[6 replies] Last: i suggest to change this: exit(EXIT_SUCCESS); with this: return 1; ... (by chipp)
Arrays
 
This is for a class assignment. "Write a C++ program that accepts test scores. The program should have a loop that allows the user to continue entering numbe...
[4 replies] Last: I would use the sentinel if I don't know how many items are in the lis... (by chicofeo)
getline function
 
Im having an issue with my getline function it seems to read nothing... Whats wrong? cout <<"Insert save file name."<<endl; c...
[1 reply] : Alright so i seem to have fixed it by just making the getline function... (by groghad)
can't use *this in a member function
 
Hello :) I'm getting the error "no matching function for call to 'myArray<char, 3>::fill(myArray<char, 3>&, const char&)'" in the header file in line 43. Here i...
[1 reply] : The error clearly states that it can't find a function fill() that tak... (by helios)
While Loop to read out file information
 
Hi guys! So I'm working on an assignment for class where we have to use a while loop to read data out of a file and display it in our program. In the program we...
[4 replies] Last: Hi, One shouldn't loop on eof , loop on the filestream instead. ... (by TheIdeasMan)
Battleship program, should not hit same location twice
 
Write your question here. Any help would be appreciated. I know the code is not very well put together, but I've been working on this for about 4 hours now and...
[1 reply] : I've overhauled my code a bit for function more properly, the above co... (by rapalabrowns)
random numbers: rand() vs. <random>
 
I'm adapting some old C++ code that uses the C library random functions, to generate number between the range of 1 - 100, for example: #include<iostream> #inc...
[12 replies] Last: @JLBorges, with your code snippet as a starting point I rewrote my so... (by closed account E0p9LyTq)
Help on array
 
I am trying to write a program that ask the user for a string and tell them yes or no, whether their string is a letter in the Greek alphabet. I am stuck on whe...
[1 reply] : #include<string> #include<iostream> using namespace std; int main()... (by closed account 48T7M4Gy)
by isom03
Output total rainfall and average temperature during the period
 
I got a loop running that will ask the user how many days of weather data they have. Then from there it asks what the rainfall and maximum temperature for the n...
[2 replies] Last: PS a, b and c are not good variable names. (by closed account 48T7M4Gy)
Code logic question
 
solved
[5 replies] Last: Thanks for the help guys! (by helloworld135)
Help With Accessors & Classes, Coming from Struct.
 
I started programming in C++ again after many years away. I am having trouble understanding Classes. I understand struct and such, but really confused as to ho...
[1 reply] : In C++, the struct and class keywords mean the same thing, the onl... (by LB)
Need Help with void prototype (sorting arrays) increasing/decreasing
 
Hi, I was struggling with the following question from an assignment I have. The code below works but the question asks to the write just the definition for the ...
[2 replies] Last: Thanks, but could u maybe explain the code especially the first two li... (by RAVSHAN02)
Lottery Lab Help
 
For the lab assignment we have to use arrays to to some kind of lottery. Our profesor hasn't been helping much with it and it's due tonight. I have very limited...
[4 replies] Last: @lhenriqu, I am sure you are getting or will get more errors than the ... (by chicofeo)
Needing clarification on why a while loop is running while value is true
 
Hi there. I'm currently studying C++ from a book by D.S. Malik and I had a question regarding the following portion of code that was used as an example. This co...
[6 replies] Last: Thank you so much! (by chanzilla)
read from a txt file
 
I wrote this simple piece of code #include <iostream> #include <fstream> #include <string> using namespace std; int main(int argc, const char * arg...
[1 reply] : ~ is interpreted by the shell, so don't use in a C/C++ program. file.... (by kbw)
I made a mistake in the following program
 
I recently started C++. I am making this program in which I have to input the value of "x" and the program will calculate the value of "y". Whats the mistake ...
[4 replies] Last: and give me the answer The answer has been worked out - that's why... (by closed account 48T7M4Gy)
by qia360
HELP simple Hello World in codeblock won't run in Mac
 
Im a newbie and want to learn writing c/c++ programs.. i have a Mac OS X Yosemite 10.10.5 and just downloaded the new version of Code::Block 13.12 the simple...
[3 replies] Last: thanks for the reply.. I have all tried your suggestions..and write li... (by qia360)
How do I find the number of characters in a word in a string?
 
I want to take a string, find a word that the user searches for and also find the number of characters in that word. Here's what I have so far. I omitted some...
[4 replies] Last: I got it working. Thanks! (by FuManchu)
Printing char[][] in a function
 
Hi, let's say we have declared char matrix ; int x, y; and then we do printout: for(x = 0; x < 3; x++) { for(y = 0; y < 4...
[3 replies] Last: You could use a c++11 array of arrays (or vector of vectors) & query t... (by Norm Gunderson)
October 2015 Pages: 1... 2627282930... 57
  Archived months: [sep2015] [nov2015]

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