Beginners - December 2018 (Page 4)

I need of help on very basic question
 
How can I start on a new line after each time the nested loop is terminated? To clarify, I mean each time the nested loop is finished and the outside loop start...
[1 reply] : Do a cout << endl; after the inner loop finishes: #include <iostrea... (by AbstractionAnon)
by mcr99
Project Euler #14
 
I'm a beginner, I'm trying to solve problem 14 of Project Euler (https://projecteuler.net/problem=14). Here is my code; Can anyone help me to figure out what I'...
[3 replies] Last: You're welcome. You can speed it up quite a bit (although it's not rea... (by dutch)
Arrays return different results for the same indexes
 
I was trying to make a multidimensional array implementing pointers. However, the SAME array produces two different results two times I access it : breakpoint 1...
[3 replies] Last: Yes, it compiled. Runtime sized arrays are an extension supported by... (by dhayden)
count() in map
 
I am new to maps in c++. Can you tell me what is wrong with my code? I want the number of occurrences of the second string Issue- currentcnt is always ...
[2 replies] Last: > I want the number of occurrences of the second string std::map::co... (by JLBorges)
Sum of two numbers in array
 
Question- https://www.hackerearth.com/practice/data-structures/hash-tables/basics-of-hash-tables/practice-problems/algorithm/cricket-balls/ Issue- Code...
[6 replies] Last: @ne555 Oh yes, this was the issue. selection of one box was not allow... (by closed account 1vf9z8AR)
by berce
Checking if input is integer with regex
 
Hi everyone; The folowing code is working but it works correctly with one chracter. So sees 1aa as an interger. so looking at the first character Is it poss...
[7 replies] Last: thanks everyone. @dutch I tried it's working 2 good int: 2 2s bad in... (by berce)
.exe file opening and closing too fast?
 
Hey y'all, I'm brand-new at coding and have just written my first .exe file. When I try to open it, though, the window pops up briefly on the screen and then s...
[3 replies] Last: Ohhhh! Thanks a ton! :)) (by yaamart)
Calling template function
 
Hello guys.I want to call function for my template but i don know how.I trried this syntax,but it is not true. int x = matrica1.GetElement<int>(2, 5); I ha...
[1 reply] : T GetElement(int x, int y){ return this->p ; } int x = matrical.Get... (by ne555)
Help with Pointer syntax
 
Hi, I'm going through a tutorial/quiz thing, and I think I generally get the basic concept of pointers, but I seem to struggle with understanding the syntax ...
[8 replies] Last: Hey, thank you both (lastchance; jonnin) for your rapid replies. This'... (by Cheddar99)
Game theory optimization
 
I have been trying to understand game theory problems for a while and every time I try out a problem , I always end up using the brute force approach, can any o...
[13 replies] Last: These inputs are actually really small for any k >= 2 due to exponenti... (by Browni3141)
urgent response neaded
 
My teacher at senior high has asked for us to hand in a project Unfortunately, i have no idea, as to how to do it and if i don't i will fail the subject and re...
[8 replies] Last: [quote=keskiverto]We know that Ben can take 1, 2, or 3 on the first tu... (by Browni3141)
AYUDA!!!!
 
print("bienvenido"); print("Presiona 1 si eres chico o 2 si eres chica"); int i = GetInt(); if (i == 1); //Parte de varon { p...
[1 reply] : Please, Alexis929, try to enhance your question or you are not likely ... (by Enoizat)
by Grime
Arithmetic vs Logic
 
Hey this is just a small thought that I was having. I know that this is VERY minute but still. Suppose you had to search a string for the occurrence of two s...
[9 replies] Last: What about this one? str = "cscscscc" occurances ; for(int i=0; i < ... (by Konstantin2)
Getting duplicate definitions even when using header guards
 
I've got an application, and I've been trying to move related code off to separated .cpp files, and link things via .h files. Because the code all ties to thin...
[7 replies] Last: @zydeholic You're welcome - glad I could help! (by MikeyBoy)
by Grime
Force a parameter to be lower than something? (how to cause assertion)
 
This might be a little too fancy but I was just wondering if it's possible to do in C++. Suppose a function: unsigned short int rand(const unsigned short int&...
[13 replies] Last: You're welcome - hope it helped! (by MikeyBoy)
Substring Problem
 
Q: Find the longest substring that contains at least one character who's frequency is greater than or equal to the (length of that substring)/2.. constraint:...
[4 replies] Last: @dutch ?? (by closed account N3wCDjzh)
Should I use a vector of iterators here?
 
Hi I have a class which contains a vector V (which is a private variable). The class has a member function which searches V for certain elements E and needs ...
[3 replies] Last: Don't return iterators. The caller shouldn't know or care about how yo... (by dhayden)
(How to) Friend declaration of a nested iterator class towards its container class
 
Hi everyone! I'm having hard times implementing a nested iterator class in a template container class which I'm making. I'd like the iterator class to be ...
[2 replies] Last: ne555 You are right about the postfix version. I pasted the implement... (by cppStudent012)
by Grime
How do I write an artibrary precision datatype?
 
I want to write my own integer data type that has arbitrary precision. Where do I start and what prerequisites might I need to know? After integer I want to do...
[5 replies] Last: This might be worth a read... Bignum Challange http://www.cplusplus.... (by closed account z05DSL3A)
by Grime
How to template determine return type and passing type? (modifier)
 
I want to have two overloads of a function one that returns int and another long long int based upon the value that is being returned. Can template do this? W...
[2 replies] Last: Can template do this? Yes: template<typename result_type> result_type... (by coder777)
December 2018 Pages: 123456... 22
  Archived months: [nov2018] [jan2019]

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