Beginners - January 2017 (Page 2)

Converting my program into a function
 
Okay, so I've been trying to figure out how to turn my program into a function, but I don't know a clear and concise way to do it. Could someone please show me ...
[1 reply] : Your input is the precision (e or epsilon) and the output is the sum, ... (by lastchance)
SFML, drawing a vector of shapes
 
Hey all, I just got back into coding. Trying to make a simple breakout game, I did start of just making a simple 'pong' game but found it quite easy so I am try...
[4 replies] Last: I have made all the edits you suggested, I can see the 10 blocks on th... (by DylanMorganx)
Embeding a DLL within another DLL and interface with LoadLibraryA
 
Hopefully a simple question. I have a small c++ dll with a header that was provided to me to use withing another c++ dll project. Now that I am approachin...
[no replies]
Can' t run code that worked before
 
I am using Codeblocks and I wrote a programm from the beginner exercises. Everything worked fine until recently when I executed the program again and the consol...
[3 replies] Last: Thank you, I don't know how I could oversee this dump mistake (by Fajsdie)
Trying to understand tokens and classes
 
I pretty much have no idea how classes work, so I'm just doing some trial and error. I'm trying to figure out how this class distinguishes kind from value. For ...
[2 replies] Last: Line 21 - do you mean for the middle condition to be i < 10 ? ... (by wildblue)
by pumzye
How do i skip a character ?
 
Hi Guys I have two questions; (1)how do i skip an unwanted character while reading from a file ? (2) how to i limit the number of characters i want to ex...
[4 replies] Last: herewith the code its not picking up nor skipping #include <iost... (by pumzye)
some problem
 
...apparently I found some problem here when I tried converting char array to string #include <iostream> #include <sstream> #include <string> #includ...
[2 replies] Last: thanks (by Flaze07)
Strcmp for fstream
 
I am trying to write a program that counts the number of 'the' and 'is' in a file. Why is it that my code won't work when I use if (strcmpi(a,...
[2 replies] Last: You are writing a C++ program; so use C++ facilities: in this case st... (by JLBorges)
decrypting a Caeser cipher
 
.
[6 replies] Last: Sorry for the late reply. What is the problem? (by coder777)
Taking integers from input.txt
 
I am currently stuck on how to differentiate integers from each line in a text file. The input file consists of 2 lines. The first line has two numbers, the sec...
[4 replies] Last: I think the introductory sentences from the OP are a dead giveaway tha... (by closed account 48T7M4Gy)
Need help with extraction operator overload
 
I think i'm missing something when i call the getDATA method in the List class. #include <iostream> #include <fstream> using namespace std; class...
[4 replies] Last: Your post doesn't show exactly how you tried my suggestion so I can't ... (by gunnerfunner)
Output always 0
 
Hi, When I enter 20 for weight_t and 10 for weight_r, I want each of them to divide by 100 which would give me a result of .20 and .10. However, it always outp...
[2 replies] Last: while (weight_t != 0) weight_t = weight_t/100; This lo... (by integralfx)
Dynamic Memory in Classes?
 
Hi. I need help with trying to figure out using this array across different functions for a class. Here is my task: "Implement the class illustrated below,...
[8 replies] Last: Can you use reference? void RandomArray::getAverage( double &average... (by Mantorr22)
Check for winner
 
I am working on a tic tac toe program. How do I check for a winner? Here's what I have so far #include <iostream> using namespace std; void board...
[3 replies] Last: It may be easier to understand if a two-dimensional 3x3 array is used ... (by JLBorges)
Date Class C++
 
Hi guys! currently making a Date Class and as I am compiling in g++ I am getting the following errors when I compute my Datemain.cpp file: [rrazzak@cloudland...
[6 replies] Last: @ thenomster You should always compile with -Wextra -pedantic-error... (by TheIdeasMan)
Is there a way to allow the user to populate an Array with "cin"?
 
I have an excercise to do for college and one of the questions is as follows a. Write a prototype for a function LargestInputValue that will allow the user to ...
[3 replies] Last: allow the user to enter a list of positive integers, followed by a te... (by closed account E0p9LyTq)
by deady
Hangman, Lowercase Input for Uppercase letter is invalid
 
Almost done with the code for my hangman assignment, I just need a bit of help (or at least a huge clue) on how to count a lowercase input as correct. Let's say...
[7 replies] Last: You need to convert the input to uppercase. #include <iostream> #inc... (by Mantorr22)
by pumzye
While !End of File terminating program premature
 
Hello My code is terminating prematurely due to while !eof Please check and advise, thank you. //Write a program that takes its input from a file ...
[13 replies] Last: From www.mathsisfun.com/data/standard-deviation.html (emphasis added):... (by dhayden)
Help with for loop with vectors
 
I'm trying to make a program to help me with my material science homework. Pretty much I just want to calculate the normal stress given a set of values for load...
[4 replies] Last: Further to the other replies: Avoid using float , it's precision is ... (by TheIdeasMan)
classes inheritance (1,2)
 
let's say I have two classes. class A class B and I inherit what's in A to use it in B. class B : public A { . . . } why do functions that I use from B i...
[24 replies] Last: Okay. I understood what's the problem now. Thank you cire! This arti... (by DeathLeap)
January 2017 Pages: 1234... 24
  Archived months: [dec2016] [feb2017]

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