Beginners - March 2019 (Page 17)

Get the start and end of a char
 
I have a peice of code like this, to see whether a string entered is palindrome bool isPalindrome(int l, int r, char* s) { if (l == r) { return ...
[2 replies] Last: Thank you. Have a nice day! (by thinhphucvang)
by Alb13G
Getting int num;redefinition error in while loop
 
The problem is I'm getting a int num;redefinition error. I don't think whats in the braces is right either int num = lower_num; --- (causes a int num;redefini...
[5 replies] Last: Thanks salem c that works! Thanks everybody for your help getting me t... (by Alb13G)
How to return all the Elements of an array.
 
How to return all the Elements of an array. Hey Guys! I'm just a newbie here, I need help with my code; How do I return the values in the element? can it ...
[2 replies] Last: Thank you very much, you made it simple enough (by LucasArroyo)
by Bopaki
Error in overloading the istream operator>>
 
I get this error when compiling: ccAssignmentOprOverload.cpp:19:9: error: invalid user-defined conversion from 'char ' to 'const ccAssignmentOprOverload&' [-f...
[5 replies] Last: Here is the modified version: #include <iostream> #include "cAssignm... (by Bopaki)
by Vetzo
std::unordered_map iterator
 
Hello Forum, I have an "unordered_map" variable. I use its function "find()". I want to put its return value into another variable. std::unordered_ma...
[2 replies] Last: Hello, I found the following method: std::unordered_map<DWORD, std::... (by Vetzo)
by sturk
C++ class inheritance
 
Hi, I need help with my '=' assignment operator as shown below. Basically I need to also assign an int value along with the point. Refer below. May I know how I...
[1 reply] : Perhaps you meant this? Circle& Circle::operator= (const Circle& a) ... (by Grime)
by sara91
How to store data from text file into vector of vector
 
Hi. I'm c++ beginner. Currently, I still learn how to store data into vector from text file. I don't know I do it right or wrong. But it seem wrong because noth...
[4 replies] Last: can someone help me with this? [cpp.sh/3g4da] (by queue)
Getting a segfaulr and I can't figure out why
 
Title. I don't know why this is happening but I am getting a segfault saying free(): invalid size error is __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sys...
[7 replies] Last: > while(filein && !filein.eof()) You also need to be checking i < num... (by salem c)
by sturk
C++ compilation issue on class inheritance
 
As I am fairly new in inheritance, I have some compilation error which I do not know how to resolve. I have no where to go to and hence I come here. I would ver...
[3 replies] Last: > Point& operator = (const Point &a) This doesn't seem to be inside yo... (by salem c)
What could i do with the basics
 
So I am reading a C++ book "C++ without fear" by Brian Overland. and its a beginners book on C++ programing and I was just wondering, if I finish this book and ...
[4 replies] Last: Just reading a book (or several books) won't teach you much apart from... (by salem c)
#error?
 
What is this for, all it does is post an error message and stop the program from running. Is there any practical use for this, or is it just a thing because it ...
[2 replies] Last: #ifdef _WIN32 #error Nope! No way! Sorry, but no. #endif ... (by dutch)
error: passing 'const value_type {aka const Triangle}' as 'this' argument discards qualifiers...
 
Okay, I should note that this is homework that is due in ~1-2 days, unlike my previous posts that have been questions for homework already past their due dates ...
[5 replies] Last: Edit: Closing this, I wasn't able to figure it out so I decided I'd ju... (by PiggiesGoSqueal)
by cutwo
Asking for a review
 
Hello, this code is not running and I am having a difficult time finding out why, please help #include <iostream> #include <string> struct listNode ...
[2 replies] Last: https://en.wikipedia.org/wiki/Indentation_style 250 lines of zero inde... (by salem c)
Using cin, getline(), and maps.. Unexpected Behavior
 
I'm trying to solve this problem: https://open.kattis.com/problems/baconeggsandspam I've commented out some of my code as it's unrelated to the issue I'm posti...
[8 replies] Last: Lol, didn't even occur to me someone would/could make that connection,... (by PiggiesGoSqueal)
by caedus
New programmer stuck on self teaching question
 
Hi Guys, im currently teaching myself c++ in my offtime and im really enjoying it. However when i get to stops in the road it can be hard to push forward withou...
[6 replies] Last: You only need to ask for one number, so asking for a number should no... (by Duthomhas)
Pushing back a vector into a vector of vectors and then printing out the vector
 
Lets say you have std::vector<int> tmp{ 1,1,1,1} std::vector<std::vector<int>> tmp2; How would you be able to store the tmp vector in...
[4 replies] Last: If you want to get real fancy overload std::ostream operator>> so pr... (by closed account E0p9LyTq)
string declaration and cout function
 
Hi. I'm trying to reverse a string which read from the user, and print the reversed string. I have two issues: How to declare unknown size of the reversed strin...
[3 replies] Last: #include <iostream> #include <string> #include <algorithm> int main(... (by closed account E0p9LyTq)
How do you combine different numbers into one number ? E.g (1,2,2) = 122
 
Example : 1230304 (B) 1) 0000000 (2) 2) 1000000 (3) 3) 1100000 (3) 4) 1200000 (4) 5) 1210000 (4) 6) 1220000 (4) 7) 1230000 (5) 8) 12...
[16 replies] Last: @ Ganado, That is interesting. I must have been messing up somewhere..... (by John Davis)
How can I change my code to get a different triangle output.
 
Hi, I have this bit of code that I wrote to print a triangle that looks like this: https://imgur.com/EYKlAM0 What I want to do, is change it to look like this:...
[2 replies] Last: Yes! Thank you so much. (by skullripper675)
printing chars in hexadecimal manner
 
I want to print plain chars as hex numbers, is there a smooth way doing such? That's how I tackled it, but it would great if I could avoid the converting funct...
[12 replies] Last: #include <iostream> #include <string> #include <fstream> #include <io... (by JLBorges)
March 2019 Pages: 1... 1516171819... 25
  Archived months: [feb2019] [apr2019]

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