Beginners - November 2013 (Page 39)

by enemy
prime numbers up to five
 
Please, why is here result 5? It should count prime numbers up to 5... int Count(){ int q=1; for (int n=3; n<=5; n++){ for (int t=2;t...
[1 reply] : You are incrementing q every time n is not divisible by t. So for n = ... (by yulingo)
this program works but i know there HAS to be a better way
 
Ideally i want some way to just give ClassTwo access to the variable inside of the class one object but im not sure how to do that. inheritance, as far as i und...
[3 replies] Last: thanks ill experiment with it a bit and see if i can figure out whats ... (by MarketAnarchist)
Read from input file
 
Hello, I am trying to read from this input file: 0 0 0 1 1 1 1 0 This is what i have so far, i am using an array to obtain the info: #include <iostr...
[1 reply] : So... what isn't working? (by yulingo)
Issues with Do while
 
Basically I just want this code to repeat over if someone enters anything but y,Y, n,N using a Do while loop. But after an answer is entered it infinity loops t...
[4 replies] Last: Well, once the loop has been entered, there is no way to change the va... (by Chervil)
by enemy
Primes up to 100
 
Hello! I should write a function counting how many prime numbers it is up to 7, but I should only call the functoin from main, and function Count could give th...
[3 replies] Last: That version counts how many numbers starting at 2 and ending at 3 are... (by Chervil)
Operator overloading
 
Hi, I'm getting this from Visual Studios 2010 error C2582: 'operator =' function is unavailable in 'ArrayList<TYPE>' Basically, I want to create a new obj...
[4 replies] Last: I think I've answered your question now. ArrayList<Restaurant*> resta... (by ZedjayCoder)
Trying to reverse a string?
 
Hey I'm new and I'm trying to reverse this string but it says repeatpls::reverse does not take 2 arguments? It's in my header file.. I'm assuming I have to add ...
[6 replies] Last: Oooh ok thanks! It works perfectly now! Thank you guys :) (by closed account 2w64izwU)
by Nata
search element by index arrays help please
 
This is a code to find element by index of an array inputted. However it does not work can you please help me what I have to change? #include<iostream> u...
[2 replies] Last: I think you've gotten something switched in your head. >_> What goes ... (by Albatross)
by Nata
Please help me understand the code.
 
Hello. This is a code for array o size 20 where you can put numbers and they will be in ascending order. however, I do not understand why in last for why do w...
[1 reply] : As they are now, lines 8-17 are trivial to split off into another func... (by Albatross)
bmi class (beginner problem)
 
i'm a beginner and i'm trying to build a BMI calculator as a class, i honestly don't know what's wrong, i'm not sure how to initialize it either, help! #inc...
[17 replies] Last: sorry to be specific, a class is required and i wanted the class to be... (by closed account yAUiz8AR)
by R57x
Code Blocks #include <windows.h>
 
#include <windows.h> Error Help Me ScreenShot http://img826.imageshack.us/img826/9310/2qe0.png
[1 reply] : ¿screenshot? code is text error messages are text your problem is not... (by ne555)
by varx
passing a noncopyable class
 
I am reading a book and the author has a noncopyable class which ends up as a member variable of another class. It stuck out to me, because of the way the auth...
[1 reply] : The basic idea is to have a wrapper that can be used like a reference.... (by JLBorges)
Add statement after if statement
 
So, my program is all written out but I don't know how to use a switch statement to display a message on the output. For example, if (miles_ran == 40) {...
[6 replies] Last: The file is coming up blank. I put that in the output section right? I... (by GoodWilling)
by enemy
how to break just the inner loop?
 
Hello! I just want to count all prime numbers from -3 to 3. Result, regarding this program (which is logical but not mathematical at moment) is 1, but I want...
[1 reply] : A prime number is defined as being a number >1. Why even bother to che... (by Mats)
by enemy
return -1
 
Please, in short and clear (even for me:d) what actually means : return -1? Many thanks!!!
[4 replies] Last: In this function: int FindLinear(int array , int value, int key) { ... (by Chervil)
by enemy
what is wrong with the loop? No cout???
 
Hello! Please, why is it not writing cout??? int Count(int q){ q=0; for (int i1=-3; i1<=3; i1++){ for (int i2=2; i2<i1; i2++){ if (i1%i2!=0)...
[3 replies] Last: Many many many thanks! I was right beaking my head thinking how to so... (by enemy)
making a array
 
create an array of random numbers (7-14) (not sorted) use a for loop and find both the largest and smallest elements (integers). hint:initialize the maxn...
[2 replies] Last: #include<iostream> #include<cstdlib> using namespace std; int main(... (by thepox)
Strings - finding a letter
 
Hi, I'm trying to enter a name as a string, and then do a search for a specific letter in the string. I'm new at this. The 'first' name I want to enter i...
[2 replies] Last: Nice! Thanks you. (by project science)
click!
 
How can I make my console application know when you click the left mouse button?
[3 replies] Last: FWIW: if you're doing stuff like this... you're better off leaving th... (by Disch)
Help with CONSTRUCTOR
 
Write your question here. #include "functions.h" #include <iostream> #include <iomanip> using namespace std; diameter::diameter() { //constructor se...
[4 replies] Last: Hey guys I could finally built my solution, I just noticed I am missin... (by jonnhynick)
November 2013 Pages: 1... 3738394041... 80
  Archived months: [oct2013] [dec2013]

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