Beginners - July 2019 (Page 9)

move constructor and assignment
 
I have took the program from the article : #include <iostream> #include <string> using namespace std; class Example6 { string* ptr; public: ...
[7 replies] Last: If you do ask: Can a class have all four members (copy ctor, move ctor... (by keskiverto)
by despo
help plz - Circular Merging
 
I have got 10 marks in 2nd subtask. I have tried all brute force approach but not getting the AC except the 2nd subtask. Plz can someone suggest some approach...
[1 reply] : Deja vu: http://www.cplusplus.com/forum/beginner/256890/ and http://ww... (by keskiverto)
Minimum and Maximum CodeChef
 
https://www.codechef.com/JULY19B/problems/MMAX a little bit hint will be great. what is wrong with my I am getting WA Chef has K chocolates and he wants to ...
[11 replies] Last: @abo can't find your explanation someone reported it (by gokuluffy)
Rock Paper Scissors
 
Hi! I am reviewing the things I learned in the first half of my CPP class for this upcoming semester. How can I put this in a function? std::cout << "Player ...
[10 replies] Last: Why did you add 2,0 under win++ and 0,2 under lose++? if 2 is scissors... (by gongong)
Morse Decoder/coder
 
The c++ programme does not give the complete output. i.e. Output Decode MORSE code enter 1 Code Char to MORSE enter 2 1(input given) Enter the morse code .- -...
[9 replies] Last: @dhayden, Thank you for the input and along with the little bit of re... (by Handy Andy)
Inheritance
 
Why is this error? class Polygon { protected: int width,length; public: Polygon(int n,int m) : length(n), width(m) {} }; class Triangle : public ...
[2 replies] Last: #include <iostream> // I swapped the order of length and width sinc... (by dutch)
Why the programms doesn't works?
 
I made little zodiak's signs finder(?) and it seens to be working but does nothing in command line. i used russian to get output, the strange symbols are zodiak...
[1 reply] : There's a much easier way to parse out the day and month from the file... (by dhayden)
by huhu
minimum and maximum
 
https://www.codechef.com/JULY19B/problems/MMAX a little bit hint will be great. what is wrong with my I am getting WA Chef has K chocolates and he wants...
[no replies]
help plz - Parity Again
 
I have got partial in this question. I m getting tle in 2nd subtask.But I have no idea how to get ac. plz help me. Tried a lot. https://www.codechef.com/JULY1...
[2 replies] Last: . (by rollins)
Minimum cumulative sum when combining adjacent elements
 
'N' positive integers are placed in a circle in such a way such that for each valid i, A(i) and A(i+1) are adjacent, and A(1) and A(N) are also adjacent. W...
[4 replies] Last: Deja vu : http://www.cplusplus.com/forum/beginner/256890/ [quote=Mik... (by keskiverto)
Cast to different uint possible?
 
I want to write such a function, which depends on the encodingType (We just consider the int: 0, 1, 2, 3) cast the base_pointer to different uint pointer. Then ...
[7 replies] Last: I don't think my idea works very well after all. It's easy enough to p... (by dutch)
by Bopaki
Why can't I display all the nodes from myList
 
When I run the program only the last node is displayed Enter a list of integers ending with -999. 2 15 8 24 34 -999 When I run the program I get: 3...
[4 replies] Last: Its all sorted out now.... Thank you all!!! (by Bopaki)
INTEGERS -- SUM
 
M adjacent integers M1,…,MN are inserted in a circle the following operation can be done M-1 times pick 2 adjacent nos. and sum them up and store it in a v...
[8 replies] Last: No. No code. No ideas. [quote=Mikeyboy]If this is a Codechef problem, ... (by keskiverto)
Pig Latin Name
 
Hi! I am reviewing the things I learned in the first half of my CPP class for this upcoming semester. How can I optimize this following code? I also thin...
[3 replies] Last: vector<bool> table(256) = {false}; table['a'] = true; //you can hard c... (by jonnin)
Checking for harshad numbers
 
Hi, I'm trying to write a program that will take in an integer N, then, starting from N, loop to a limit of 1 billion, printing the first harshad number that i...
[16 replies] Last: Huh.. okay yeah that is pretty sick (by highwayman)
friend
 
Why does this program doesn't work?? #include<iostream> #define pi 3.141592654 using namespace std; class Triangle { int base, height; publ...
[3 replies] Last: So there isn't. That's me told for reading it too fast. (by Repeater)
const member function
 
I am wondering why the const member function .get() has to return a const value, and need to pass by reference. For example, int get() const {return x;} won't...
[1 reply] : > For example, int get() const {return x;} won't work it does work. ... (by ne555)
Understanding const variables being "local to a file"
 
Hello, In c++ primer 5th ed, it mentions that const variables are local to a file because the compiler will replace, in code, a const variable's name with it...
[4 replies] Last: @Niccolo, I think you should write a blog. You always supply lots of ... (by mbozzi)
get value attribute from other class
 
Good morning, I instantiate class A and set its own attribute (example A.pippo) in main.cpp. How can I get A.pippo from another class? Thanks
[1 reply] : #include <iostream> struct A { explicit A( int pippo = 0 ) : pip... (by JLBorges)
by medosz
Square with while statement
 
I am struggling with this program. It reads the size of the side of the square then it should print a hollow square of that size of asteriks and blanks. I have...
[9 replies] Last: Thank you, I got it (by medosz)
July 2019 Pages: 1... 7891011
  Archived months: [jun2019] [aug2019]

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