Beginners - June 2016 (Page 3)

Pass class object by reference and call it
 
Using this code: class A { public: function1(); function2(); //---------------------- int main() { A aObject; ...
[2 replies] Last: Cool. Thanks a ton man! (by ash54546)
Why can we check the summation of all prime divisors till n just by iterating through the square root of n?
 
The algorithm goes something like this: 1) input n 2) int sum is 0 2) for x: 1 to sqrt(n) 3) if x is equal to n / x then add x 4) else if n % x == 0 then ...
[8 replies] Last: Thanks that helped. I was thinking of it the wrong way. (by coderaashir)
by yiddo
Array of Objects(Shop Items), how to set a price tag for each?
 
Hello guys. I'm pretty new at C++. I have to make this Shop-type of program, by using Array of Objects. Problem is i can't come with idea for 2 of the functions...
[5 replies] Last: welcome :) (by shadder)
Writing a program to find the different number of ways I can make change
 
Hi there. I was looking for some help, mainly with the thought process that is involved with writing a program that takes an int input and returns the number o...
[3 replies] Last: Sometimes it helps to start with the data that you need. You need the... (by dhayden)
help with a while loop using sentinel
 
The purpose of the program is to use a function to read multiple inputs of "homework grades" and then calculate the weighted score for the homework and return t...
[1 reply] : Line 7: hwscore, hwweigh and hwmax are all uninitialized variables. ... (by AbstractionAnon)
Sum of two arrays
 
I am reworking a previous post http://www.cplusplus.com/forum/beginner/183495/ and have added the braces as suggested in the post but I am still receiving...
[2 replies] Last: I copied your code exactly and it is working on my end? Try coping it ... (by ajputnam)
Morse Code (1,2)
 
In my desire to improve at programming I wrote the following code to convert english to morse and morse to english. I am currently a new student, only three ...
[22 replies] Last: #include <iostream> #include <map> #include <string> void display_me... (by closed account 48T7M4Gy)
Visual Studio Confusion
 
I coded a calculator that could solve normal expressions, (3+5, 6/7), and then I added a feature that could factor quadratic trinomials (ax^2+bx+c, this is unfi...
[6 replies] Last: Thanks guys you were very helpful. Upon removing isdigit, my code stop... (by RUNNER PRO AGARIO)
taking data from a file,converting, then writing to a sperate file
 
Hi Everyone, I am new to C++ and am trying to complete a program that will read integers from a .txt document, convert them in the program, and then write them ...
[2 replies] Last: #include <iostream> #include <fstream> // use later #include <st... (by closed account 48T7M4Gy)
Game Crashes, Cannot Loop within a "GetAsyncKeyState()" function
 
Hello all, I am trying to make my own version of the "Space Invaders" game. I have all of the keystrokes in my code working except for the space bar one which s...
[7 replies] Last: The projectile doesn't appear Again: It does not appear because you t... (by coder777)
Basic Repetition finding max and minimum
 
Hello everyone, I gots a question. This is how I wrote it, the run and compiler works fine but here's the problem. Note this is homework. 1. The last two n...
[1 reply] : Your program isn't written right. Main thing is it doesn't have main f... (by Abhi589)
What went wrong? - sorting array
 
#include<iostream> #include<utility> using namespace std; int main() { const int size = 6; int array = { 30, 60, 20, 50, 40, 10 }; ...
[3 replies] Last: Yeah, it's really simple. Far simpler than dealing with arrays. And i... (by Yawzheek)
Multi dimensional Arrays
 
I'm having trouble figuring out how to program the argument for a multi-dimensional arrays. In this function I am supposed to create an array with two sets of i...
[2 replies] Last: Yes there seems to have been a typo o the assignment oh well thank y... (by vinny15)
by tira
It keeps saying i have a statement missing after my logical expression
 
#include<iostream.h> #include<conio.h> #include<math.h> int main() { //input float age, weight, HeartBeatRate, CaloriesBurned, minutes; char gende...
[6 replies] Last: Also, just as advice don't use <iostream.h> , use <iostream> . iost... (by RUNNER PRO AGARIO)
Error: 'cout' does not name a type
 
On line 50 I am getting an error that reads "error: 'cout' does not name a type. When I Google this issue I see multiple people saying to include the namespace ...
[3 replies] Last: http://www.cplusplus.com/forum/beginner/193392/ Use code tags and avo... (by closed account 48T7M4Gy)
Program takes one number and then does nothing
 
The below builds without errors, however the issue is when it is running and it take 1 number and then doesn't do anything else. I am trying to write a program ...
[2 replies] Last: http://www.cplusplus.com/forum/beginner/193388/ Please use code tags ... (by closed account 48T7M4Gy)
by FBHSIE
Logic operators
 
Just some confusion I'd like to clear up. If you take an AND and NOT it, you have a NAND: !(a&&b) what is Nand saying? It's not boxes and chocolates? So, ...
[8 replies] Last: Yeah, Yawzheek. I was talking about the constructs, haha. You answer... (by FBHSIE)
How to connect to the internet in a C++ program
 
I'm fairly new to the world of programming, so sorry if this is a stupid question. I've taken a college course in C++ and while I'm by no means an expert, I und...
[1 reply] : Hi, you may start with learning sockets google for resources/tutoria... (by shadder)
if else compiler problem and parallel arrays
 
i'm not sure if it's because of the way i'm structuring the parallel arrays that's causing the compiler not to run through all the possibilities, but i'm trying...
[5 replies] Last: update: never mind i fixed the problem, thanks for your help everyone (by hibiscusleaves2544)
by Darven
VOCE multiple definition error
 
Hello, I'm new here, and I tried using VOCE (http://voce.sourceforge.net/) to create a simple voice interface for basic tasks, on QtCreator (using Qt 5.7). My ...
[no replies]
June 2016 Pages: 12345... 25
  Archived months: [may2016] [jul2016]

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