Beginners - October 2017 (Page 26)

by aedt
unique_ptr<T>* question
 
Hi I have been learning and familiarizing with std::unique_ptr and so I decided to emulate std::vector. At line 63, I want my current vector to point at the new...
[1 reply] : &data = &new_data &data is the address of the unique_pointer. You... (by Repeater)
Checking if two strings are mirror of each other
 
Ok so I am trying to check if two words are mirror of each other. For example, string1 = abc and string2 = cba they are mirror of each other. The 1st loop is f...
[3 replies] Last: Thank you for the help! (by zzQwerty)
Bad Output
 
I sent my Exercise to my teacher already, but my question is about the output. I want to the output to be something like this. LoriBeth Allen 19...
[6 replies] Last: Thanks. My class doesn't really do std::stream manipulator anyways. (by leewilliam236)
Hollow Triangle
 
Hello! I am trying to write a program that prints a triangle, with the size based on the base value entered by the user. I got the triangle to print, but now I ...
[1 reply] : //Create triangle shape based on inputs for(i = 0; i < base; i++)... (by closed account 48T7M4Gy)
by Lado
Read a string into array ?
 
Hi, So I´m trying to read from a file into an array. First I read through the file with getline and from there I read the file into a function that tak...
[1 reply] : Hello Lado, Good question. If I know what you have done and what you ... (by Handy Andy)
by soby96
Alternative to if else?
 
SOi wrote this code for the recursive method and I really wanted to know if I can do this problem without using if else. what would be the appropriate replaceme...
[2 replies] Last: Thank you very much! (by soby96)
Help with code
 
I'm trying to make a program that drawas a box. I've tried to rewrite it several ways but can't get it. using namespace std; bool drawOn; const int width =...
[no replies]
Average Calculating Wrong in the Loop
 
Hello. I'm wondering if someone can help me fix my code. I have everything set-up, except my output numbers are not calculating correctly. My counts for the num...
[1 reply] : I actually got the average working now, but am still having trouble wi... (by scoutlikescookies)
by chuvak
Program is not entering the loop as expected
 
Hi forum, For some reason, when I run the below code, I always get the following output: Canada Revenue Agency Account App ===========================...
[4 replies] Last: Your question is too vague to answer. Can you be more specific which l... (by ak8912351)
Basic File I/O Question
 
Hello - For some reason when I am trying to assign the text file data to the appropriate variables, I am having some problems with it skipping over the town nam...
[1 reply] : Remember that when using the extraction operator>> extraction stops wh... (by jlb)
by Ch1156
Help with inheritance and virtual functions
 
Im trying to learn how to use virtual functions and inheritance, i folloiwed an example but made my own classes and functions, when i compile the program i get ...
[8 replies] Last: So could you show me a full working example of what you think is the ... (by Enoizat)
by chuvak
Access violation
 
Im running into an issue with the compiler, trying to understand what is wrong here. //header #ifndef SICT_PASSENGER_H #define SICT_PASSENGER_H names...
[11 replies] Last: "" == nameString Here, you are comparing a pointer to a pointer. Yo... (by Repeater)
by Sentoo
Better Random Number
 
Bear with me here guys as I am dumping a lot of codes. Hopefully you guys are feeling generous and check it out to help a brother out. Any help would be greatly...
[4 replies] Last: Sorry about that. I'm gonna edit it so it compiles. Thanks for pointin... (by Sentoo)
First program
 
Hello all. I am looking for helpful tips on how to make my program more efficient. i.e. utilizing pointers correctly, passing info, etc. I want to make sure ...
[8 replies] Last: edit: I just realized POS is just position, but you have other places ... (by jonnin)
loop
 
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include<time.h> #include <stdlib.h> int main(void) { //declaretion int guess; int i; int lower...
[5 replies] Last: So inside the loop, get a number from the user. You already wrote code... (by Repeater)
by soby96
printing "no solution" when the value is not in the loop.
 
what i am trying to do is to print no solution if the value of x and y is not there. but it is printing no solution in loops even if the the value of x and y ex...
[6 replies] Last: It's better to declare variables only when you really need them. #i... (by Enoizat)
Display Problem
 
The code works just fine except for one small problem. Basically it takes the first letter of every word inputted and creates a new word with those letters. My...
[3 replies] Last: Hello donda97, You are welcome. If you have your answer put a green ... (by Handy Andy)
Input negative integer
 
I tried to write inout that allows user to input negative integers, but figured uot can't do it with "standard": int x; std::cin >> x; With what cod...
[1 reply] : type -1 without a space between - and 1 (by closed account 48T7M4Gy)
by Altis
Number guessing loop
 
What's wrong with this loop? \\this is a number guessing game. #include <stdio.h> #include <stdlib.h> main() { int number; ...
[7 replies] Last: Lot's of small things to consider. #include <stdio.h> #include <stdl... (by closed account 48T7M4Gy)
Code Error Help
 
Hello, I'm working in Dev C++ and I had some problems with my code. It wont compile giving me an error signal. The code was implemented to read in a data file, ...
[6 replies] Last: Your program runs with the following output: unique item: bread fork... (by closed account 48T7M4Gy)
October 2017 Pages: 1... 2425262728... 33
  Archived months: [sep2017] [nov2017]

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