Beginners - December 2018 (Page 2)

cin.get not holding console
Following is a simple programme which i wrote for calculating array length. #include<iostream> using namespace std; int arz(int ard ) { int d=0,i=0...
Dec 29, 2018 at 8:14pm
[2 replies] Last: [code firstline=17] cin>>x; int are[x+1]; @ brijvit I would ... (by TheIdeasMan)
Is this a good way to recursively explore a tree structure?
Hi I have objects in a tree data structure and need a function to explore an object's parents/grandparents. I've written the following: void findEnts...
Dec 29, 2018 at 5:54pm
[1 reply] : A tree can have many children for each parent, but a child never has m... (by Browni3141)
map question
Complicated errors :/ Not telling which line has problem. https://www.hackerearth.com/practice/data-structures/hash-tables/basics-of-hash-tables/practice-probl...
Dec 29, 2018 at 5:11pm
[10 replies] Last: Yes, the end result is the same. (by Peter87)
by SMF
Linking Boost Library to qt
I recently downloaded qt to be able to create a GUI for my C++ program and was wondering how I can link the boost multi-precision library that I have downloaded...
Dec 29, 2018 at 5:01pm
[3 replies] Last: Right, let's look at that error message: "no such file or directory:... (by Repeater)
Error link1168
Hello everyone.My program was working but suddenly after i just changed some numbers it started to fail with error link1168 This window pops out _CRT_SECUR...
Dec 29, 2018 at 4:13pm
[4 replies] Last: Hello Zivojin, Your error is about not being able to write to the fi... (by Handy Andy)
What is wrong with this?
I am trying to write this such that [teaching c++ online course]: 1) reads a Cartesian point 2) calculates distance from origin 3) finds distance compared to la...
Dec 29, 2018 at 3:52pm
[3 replies] Last: No. Variables aren't created in function declarations, and line 10 isn... (by mzimmers)
Is there any way to pass a value to outside of a switch?
For instance, i want to pass the int a from case1 to outside of the switch statement for(;;){ do{ switch(XX){ case1: int a; case2: default: } (can i get th...
Dec 29, 2018 at 10:45am
[3 replies] Last: ty bro (by LeslieLeslie)
by mcr99
Read Input from Text file
I have a text file with some names in this format: "MARY","PATRICIA","LINDA","BARBARA","ELIZABETH","JENNIFER" How can store each name separated on ...
Dec 29, 2018 at 9:38am
[3 replies] Last: You don't need erase() and (in this instance) the comma is irrelevant.... (by lastchance)
by Bopaki
Getting a wrong output when running the program
Everything looks correct on this project, but the output is not correct. Here is what I get as output: Student Name: Lisa Miller Student ID: 890238 Number...
Dec 29, 2018 at 9:03am
[7 replies] Last: You very welcome, Bopaki. Happy coding. (by Enoizat)
Converting vectors into a 4 digit number
Hello. I was recently doing a coding challenge where one step includes rearranging the digits from a 4 digit number to make it the largest it could be, using a ...
Dec 29, 2018 at 4:40am
[1 reply] : One quick and dirty method is to build up a string from the individual... (by closed account E0p9LyTq)
by SMF
GUI for C++ Program
I have created a C++ program on my MacBook using Xcode and would now like to create a GUI for my program. How can I do this? I created a program using Python ...
Dec 29, 2018 at 4:23am
[3 replies] Last: I was able to download Qt for free and use this to begin to create my ... (by SMF)
huge factorial
What is wrong with my program? The answer is little off. This is for calculating factorial #include<iostream> using namespace std; int main() { ...
Dec 29, 2018 at 4:12am
[3 replies] Last: @kingkush but 100! won't fit in int (by closed account 1vf9z8AR)
Why this recursive function works?
This should return true if a number belongs to an array of numbers and false if not. I don't know how this works, because I call the function only by check(n...
Dec 29, 2018 at 2:42am
[6 replies] Last: Oh okay so in short having defaulted arguments before non defaulted ar... (by Grime)
Making a square root function
I understand that you can use std::sqrt. I would like to avoid using cmath library and make my own function to do this.I have tried doing things like x^0.5 b...
Dec 29, 2018 at 1:14am
[4 replies] Last: unless you are on a CPU that does not directly support it, you will no... (by jonnin)
Overloaded Class Operator
Okay, so the code below is a copy of code from an online course thingy I'm attempting, and is meant to be demonstrating overloading an operator. In this case it...
Dec 28, 2018 at 10:33pm
[6 replies] Last: I get it! That makes sense now; thank you each so much for your replie... (by Cheddar99)
convert do loop into while or for loop
convert this into while loop and for loop, this solved in do loop #include<iostream> #include<conio.h> using namespace std; main() { int num,first,second; ...
Dec 28, 2018 at 7:41pm
[2 replies] Last: Thanks....this really help me (by Mehmood Umer)
answer gives wrong
i probably solved but in last some problem and gives wrong answer please indicate the mistake #include<iostream> using namespace std; main() { int i,...
Dec 28, 2018 at 7:29pm
[4 replies] Last: Ok! (by Mehmood Umer)
Graphic library for math and geometry
Hi everyone. I am looking for advice on which library to use for creating graphic elements. What I want to represent are geometric elements as vectors on three-...
Dec 28, 2018 at 6:08pm
[2 replies] Last: Thank you a lot Ganado :) I'll try to do something with OpenGL. When I... (by riccardo)
there is some problem?? first seven terms add using for loop
#include<iostream> using namespace std; main() { int i,j; float f,sum; sum=0; for(i=1;i<=7;i++) { f=1; for(j=1;j<=i;j++) f=f*j; s...
Dec 28, 2018 at 6:07pm
[2 replies] Last: Thank you very much... (by Mehmood Umer)
How do to call this function
Write your question here. #include <iostream> #include <cmath> void quadsolve(double a, double b, double c, bool& real, double& x1, double& x2){ ...
Dec 28, 2018 at 4:01pm
[4 replies] Last: AH! I did not know you can just call a function like this, sorry still... (by imperialcplusplus)
December 2018 Pages: 1234... 22
  Archived months: [nov2018] [jan2019]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.