Beginners - March 2019 (Page 9)

by Vetzo
allocating memory vs creation
 
Hello Forum, As I understand it (please correct me if I am wrong), there is a difference between allocating memory for a variable, and the actual creation of...
[5 replies] Last: Thank you for all the information. An interesting topic. (by Vetzo)
String to vector
 
The goal is to take a string like: "a -1 4 -1 -1 -1 -1 -1 8 -1" and turn in into a vector that holds -1 at (skips a, no letters), 4 at , ect.. This is ...
[4 replies] Last: Use istream::peek() to skip ahead until you see a digit. The only comp... (by dhayden)
Compilation g++
 
Hello, I'm a beginner and I have two files one .cpp and the other .h, How I compile the whole? Because if I try g++ AccountTest.cpp throws an error message...
[1 reply] : Use double quotes when including your own headers. #include "Accoun... (by Peter87)
I'm having issues with subtracting a value and iterating during a loop.
 
I'm trying to create a loop that calculates interest, subtracts it from the balance, and continues until the balance is equal to 0. For some reason, the loop do...
[2 replies] Last: Hello kadengolda, It would help if you post the Specs, (specification... (by Handy Andy)
How to use the output of a text file
 
Dear all, I would like to use a fonction to read the value (int) within a text file. The text file contains just one line with an Int value (0/1). So, to r...
[3 replies] Last: Thank you so much for your help. Regards, (by cherault)
deleting new operator memory
 
Hi, I have a zybooks online assignment and I'm having trouble doing what it's asking me to do. It wants the allocated memory in kitchenPaint deleted, but somet...
[3 replies] Last: delete should be used when deleting an array . delete (without ... (by Peter87)
playlist wp
 
how can i create a playlist player sample under site ? http://www.17musicbaran.us/music/evan-band-alijenab/
[no replies]
How to pass a dynamic 2d array as a parameter in C++
 
I am trying to implement a binary tree as a 2d array. Now I want to the user to enter the required height of the tree and the program gives an appropriate size ...
[3 replies] Last: How to pass a dynamic 2d array as a parameter I know I am going to h... (by closed account E0p9LyTq)
Abstract Class
 
I am confused, I hope somebody can clarify this for me - Thank You in advance. ABSTRACT CLASS : Let's assume I have a BASE ABSTRACT CLASS and two DERIVED ...
[2 replies] Last: Your latter hunch is right, it is making two variables. +-----------... (by Ganado)
by totoo
rock paper scissors shoot
 
ALSO, if the user were to input a char instead of int, it just loops the ERROR-2A... thanks in advance!
[4 replies] Last: Hello kyoo, Do not edit and remove anything from your original post. ... (by Handy Andy)
Fruitful use of reference
 
Still new to C++ I try to get used to the kind of reference of this site, for example for unordered map here: http://www.cplusplus.com/reference/unordered_map...
[17 replies] Last: bogus personal data So did I. And I wondered what funny date of birt... (by MikeStgt)
atoi
 
Rolando Flores You are the one who likes to delete after someone helps you, right? See the link below: http://www.cplusplus.com/forum/beginner/251214/
[1 reply] : I saw the code before he bugged out, he clearly had no idea how to use... (by closed account E0p9LyTq)
idk
 
Lines 8 and 9 are in the wrong order. #include <iostream> void print_reversed_lc_letters( const char *str ) { if( str != nullptr && *str != 0 ) { ...
[3 replies] Last: Maybe he finally did get the memo, he closed his account. (by closed account E0p9LyTq)
vector<> and erase, insert
 
Want to use erase(), insert() instead of *iterator = value: It hangs the pc ;) void replace(vector<string>& vec, string old, string replacement) { vect...
[2 replies] Last: thanks a million lot!! to you peter, great knowledge (by olefredrik)
by Cairus
int/char stack issue
 
I am getting an error stating 'error: cannot convert 'char*' to 'int*' in assignment stackArray = new char ;' I can't seem to figure out what...
[1 reply] : You have declared stackArray as an int* int *stackArray; but then ... (by Peter87)
Sorting arrays
 
Hey there, I've just started learning about arrays and I by the help of internet created a code that sorts everything from the lowest to the highest. My questio...
[2 replies] Last: It sorts the elements from lowest to highest by default but you can ch... (by Peter87)
greatest common factor assignment
 
I need help with my lab. The point of it is to make a program that finds the greatest common factor of two numbers. We don't need to worry about negatives or ze...
[2 replies] Last: replaced repeated subtraction by reminder #include <iostream> int ... (by MikeStgt)
Create a delay between each output?
 
Hey Everyone, I have been working on a simple 'fight' program where 2 players fight each other and one comes out victorious. step by step i have been adding th...
[5 replies] Last: oh okay i see, I have been using the solo learn website. so that makes... (by BudSkigee)
Understanding problem
 
Hi good morning from Colombia i would like to share to you a problem. I was giving a try and this is what i got so far. i will be keep an eye over your...
[2 replies] Last: #include <iostream> void print_seperate_digits( int number ) { ... (by JLBorges)
Replacing vowels from inputted string with a different vowel.
 
I am trying to fill in this code that gets a user input into a string line and replacing each vowel with a different vowel. Assuming all input is lower case. ...
[3 replies] Last: imagine if you had a function ... that returned the input character if... (by jonnin)
March 2019 Pages: 1... 7891011... 25
  Archived months: [feb2019] [apr2019]

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