Beginners - June 2018

by PoinP
Trying to make a BlackJack game
 
Hello! I am trying to make a BlackJack game. When I type "Stand" it calculates the dealer hand, but when I type "Hit"and then "Stand" it shows that the dealer h...
[3 replies] Last: Generating and displaying a deck of cards is not that hard, with some ... (by closed account E0p9LyTq)
MATH PROBLEM
 
hey can anyone tell me the count of numbers ending with 2,3,9 within a given range? is there any trick for that. here's sample find numbers between 11 ...
[3 replies] Last: There are 3 numbers ending in 2, 3, or 9 between 10n and 10(n+1). So y... (by tpb)
C++ Switch statement
 
Hello all, I am seeking help with my program. The program determines how much you would weigh on another planet. When running the program, i'm not receiving res...
[2 replies] Last: Thank you, that resolved my problem. (by Gerkers)
Help reading a file
 
Whenever I run the program, there is an error in opening the input file. I'm not quite sure where I went wrong. Text2.txt: 2345.45667 -0.0000456 34.9999 0....
[3 replies] Last: The problem with this approach is when you open the input file the fil... (by Thomas1965)
help with paramter functions
 
so my teacher wants me to create another function for this called "sumit" the function will take three doubles and return the sum of the three doubles. what im ...
[1 reply] : You need to declare the function before you can use it, like you have ... (by Peter87)
Data Structures and Algorithms
 
Adding a list of words - strings (characters without limitation) to create an index of common words in it by ignoring the letter register (small / main) Exam...
[1 reply] : Read each input into a string. If you can convert the string to a num... (by Repeater)
Passing data to a member function
 
I am starting to look at C++ and have done an introductory online course. Based on that I am just poking around trying to find my feet but have come across a li...
[2 replies] Last: You could make selection a string and use an if-else statement. stri... (by Thomas1965)
error: invalid conversion from 'char' to 'const char*'
 
Hey guys, so I want to make a program that finds and shows me all the words that contain a given amount of letters and a given letter in a specific position in ...
[2 replies] Last: char lit ; Why even have an array if you know it's 1 letter long...?... (by Ganado)
How to read user entered polynomial?
 
So initially I thought this would be easy but apparently it's terribly hard. Downright impossible for me. I store the user input as a string and try to have th...
[5 replies] Last: Thank you guys for your help! I think I need to learn more about C++ ... (by sciman777)
by bkara
Opening file explorer, then selecting a text document and then converting that text document?
 
I want the code to open Windows file explorer. Once the file explorer opens, the user picks a text document the code will then convert that document to a csv fi...
[4 replies] Last: It doesn't sound like any automation here is necessary, it just needs ... (by Ganado)
How can I obtain an hexadecimal value how a string?
 
I have to read a file and then get his hexadecimal expressed how a string, so I can modify using string modifiers. But ifstream return a vector and I get the er...
[7 replies] Last: I'm just as confused as everyone else -- what's the ultimate goal? ... (by icy1)
Problem Running Tic Tac Toe game
 
Hello everyone! I have written a very simple code regarding the creation of a basic Tic Tac Toe game. The program runs fine up until it is the 3rd turn of t...
[2 replies] Last: Start i at 0. Then at the very beginning of your while loop, increment... (by Manga)
by evano
Requesting c++ programming books and wed development books
 
Am just a c++ beginner starting my university education in computer systems and security.Therefore am here to ask your help to send me some good c++ programming...
[no replies]
Find the two largest elements in an array in n+log (base2)(n) comparisons
 
What is the significance of log(base2)(n)?
[2 replies] Last: the math is the number of comparisons needed, this is called big-O not... (by jonnin)
by EloyRD
Vector of pointers from inside a class to another class
 
I'm developing in C++ a biological simulation: hunters and preys in a grid, with random-related cooperation. For this, I have a grid of pointers to a class `Ag...
[2 replies] Last: @lastchance. Thanks a lot. I do have included: #include <iostream>... (by EloyRD)
by Dvx70
Building cpr c++ library HELP NEEDED
 
Please help me to build the cpr library https://github.com/whoshuu/cpr I got from git repository using CMAKE. I got a \build\ directory, but CMAKE gives me a l...
[no replies]
by mnai
Created a private const variable but it can still be changed?
 
i created MyMaxTries as a const variable so when i set it in the constructor i assume it shouldnt be able to change.(This is just for learning not for practical...
[3 replies] Last: if i am understanding correctly adding int infront of it creates a ne... (by tpb)
by xdigit
Trying to understand pointer and address
 
I am writing a simple code to print out the elements of an array along with their respective address. I thought that the address of elements of a given array is...
[2 replies] Last: I see, so the memory cell is represented by the bytes. (by xdigit)
Put variable into variable name
 
So let's say I have the following integers: iX1, iX2, iX3.... iX1000 (theres 1,000 integers) Now I want my program to assign 0 to whichever one the user sel...
[1 reply] : Have you considered creating an int array, filling it with a counter i... (by StMick)
by agusx
vector.erase() and finding mid position
 
Hello everyone. Im making a programm for "guess number game" I have a little problem with vector.erase() and finding the mid position of a set of elements in a ...
[3 replies] Last: Thanks a lot JLBorges and icy1! Yes icy1, you are right, I didn't exp... (by agusx)
June 2018 Pages: 123... 19
  Archived months: [may2018] [jul2018]

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