Beginners - October 2019 (Page 8)

Code Suggestions / Improvements For Me
 
Background Hello everyone! A few months ago (as well as more recently) I looked into a JSON parser for C++. In short, I found it too difficult and used an alt...
[2 replies] Last: [quote=Thomas Huxhorn]obviously ... printInstructionsAndGetInput() doe... (by PiggiesGoSqueal)
Sum of all pairs
 
find sum of all possible x+y where x and y are natural number solutions of the equation x^3 + y^3 = x^2 + y^2 + 42xy ?
[5 replies] Last: I see, so that shows that the radius is bounded, and therefore you onl... (by Ganado)
Help in this question
 
You are given an array a of integer of size N. Now, select any two adjacent indices, ifa == a[i+1], then remove both a && a[i+1] and put add a +1 in the...
[2 replies] Last: For Example if a = [4, 3,3, 4, 4,4] I suspect you meant: if a = [4, ... (by lastchance)
Help
 
Can someone Just tell me how to create your own namespace std? If you can suggest me some video for it as well as pointers and arrays. I will be thankful. Than...
[4 replies] Last: Also, if you don't know vectors yet, stop. Learn them before arrays. ... (by Repeater)
Fixing a segmentation fault
 
I believe that the segmentation fault is occurring because the object isn't getting written into the array correctly (I haven't worked much with arrays of objec...
[9 replies] Last: you are very welcome. this kind of simple mistake are why pointers a... (by jonnin)
How would you use vectors in a real life situation when making programs using vectors
 
I just learned about vectors in c++ and want to know what ways can we use a vector in a real life situation when making programs in c++.
[2 replies] Last: To make a collection of items that has an unknown size at compile time... (by Ganado)
Undefined reference error Code::Blocks (1,2)
 
Hello, I received undefined reference error at a project with three files: SUM.h, SUM.cpp, main.cpp. Give me "undefined reference to 'SUM::Sumarise()' " error. ...
[20 replies] Last: By the way, CodeBlocks Project (CBP) files are just XML, so you can op... (by Ganado)
C++ Problem
 
Write a C++ program of playing cards game. The game consists of the following rules: (20 marks) ● The game has two players, with each player taking one tur...
[5 replies] Last: @talal02: #include <iostream> #include <cctype> #include <limits> i... (by George P)
Concactenate string and user defined object by + symbol
 
Hello! See at the bottom of the code. I would like to be able to execute that code (in comments) , if possible? #include <iostream> #include <string...
[1 reply] : you need a stringstream to do that because you don't have anything in ... (by jonnin)
Kindly explain this binary tree array
 
Kindly explain this binary tree with array representation. https://www.geeksforgeeks.org/binary-tree-array-implementation/ My question is why it's printing "Ca...
[14 replies] Last: The page that I posted a link to writes: If an initializer is not pro... (by keskiverto)
Quick Question
 
#include <iostream> #include <random> #include <numeric> #include <algorithm> int main() { const int NUM_CARDS = 52 ; const int NUM_ROUNDS = 5 ; /...
[3 replies] Last: Oh okay. Indeed a very quick question ;) (by Thomas Huxhorn)
spoj SEQ problem runtime error
 
im trying to solve spoj problem SEQ - Recursive Sequence , https://www.spoj.com/problems/SEQ/ i compile and get right answer using g++ in terminal, but when i s...
[3 replies] Last: @Enoizat thankyou for the revise my code to become readable, after fix... (by surfersss)
I'm having trouble
 
I don't know what's wrong. I think it is something with the loop and the formula I have in the loop. Please help. Bianca is preparing special dishes for he...
[2 replies] Last: It often helps to “trace” through your code. Start by listing you... (by Duthomhas)
Having Trouble With This Assignment
 
I am not good with functions. I just can't really understand them overall. But I finally got to the point where my program doesn't output any errors. However I ...
[1 reply] : functions have a type and return for a reason. or they have void type... (by jonnin)
Help please
 
I need help with this assignment I do not know what im doing wrong. Write a program that accepts as input: The loan amount The interest rate per year ...
[5 replies] Last: It doesn't print line 18, but I was able to fix it. The main problem r... (by BatJuan72)
Random set numbers and its size
 
I've begun to do a new program, but I've hit a roadblock and need help. I'm trying to enter the size of a set that has a random number generator in it. So when ...
[1 reply] : set s is destroyed after size() is done. it seems like you should hav... (by jonnin)
Strings with Spaces
 
I am trying to create a program for fun that will recite the Tragedy of Darth Plagueis the Wise, and have the user fill in the correct phrases, but I'm having d...
[3 replies] Last: Let's look at save(). After indenting it looks like this: void save()... (by dhayden)
by swa9
Variables
 
Could someone explain what a variable is in depth, Ive read a lot of articles but none of them explained it in depth, maybe even send a link. Thanks.
[16 replies] Last: why does an object require an identifier to be considered a variable ... (by dhayden)
puts vs cout vs printf
 
Hello! When watching different tutorial videos on C++, some teachers still use C keywords printf and put instead of cout with C++. I am just wondering in wh...
[6 replies] Last: So, is it possible that advanced programmers mixed the two keywords in... (by jonnin)
by swa9
Object meaning
 
What is an object in terms of variables, I know that a object with an identifier is known as a variable, but what is an object?
[7 replies] Last: [quote=dexter1224]Variable and object are the same thing not quite: /... (by Cubbi)
October 2019 Pages: 1... 678910... 18
  Archived months: [sep2019] [nov2019]

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