Beginners - August 2018 (Page 10)

Problem with linked lists
 
#include <iostream> #include <stdlib.h> using namespace std; struct node { int data; struct node *next; } void push(struct node **ref, int n) { struc...
[8 replies] Last: I didn't think about the name "push" which doesn't make sense to add t... (by tpb)
finding sum
 
How to find the minimum no of element required to form a given number >= x in O(nlogn)? ex - {29, 17, 33, 21, 13, 15, 24, 20, 23} x = 100
[10 replies] Last: thats what is bugging me :) It seems like it should be doable in O(N... (by jonnin)
by step
parsing string to double with stod()
 
Hello, I would like to know how to use the function stod() with string expressions that have variables inside the string. When the string has variables (for exa...
[2 replies] Last: To expand on what Repeater said, here is some information on parsing e... (by uplime)
heap algo
 
how do i generate all permutations of an array when a no can repeat in that array with the help of heap algorithm?
[4 replies] Last: Why don't you use std::next_permutation ? #include <iostream> #includ... (by Thomas1965)
Print all the occurrences of a word in a MAP
 
Hello everyone, i'm trying to count how many paired words are present in a map as follow: map<string, string>::iterator it = dictionary.find(wordToSearc...
[11 replies] Last: Thank you very much. (by Amiplus)
UART and sprintf
 
I am going around in circles with this one and hope that someone can help. I am using an Atmega 328 running at 16MHz and Atmel Studio 7. Fuses are correct. ...
[11 replies] Last: Thanks for all the suggestions. I just found a setting in Atmel Studi... (by dabineri)
Loop doesn't end
 
hello thanks for your help in advance. i cant figure out why my loop keeps going and doesn't end when I put in 0. #include <iostream> #include <cstdlib...
[2 replies] Last: the check for play is in the outer loop. the inner loop will not stop... (by jonnin)
by hehe
Help me fix this code
 
Hi, i want to make a Voting system in c++. The idea is that you could write your own party and then people could vote for it. and over and over again. (This cod...
[3 replies] Last: I think I understand what you want to do, first of all ask the user d... (by adam2016)
fscanf in C++
 
Hi I want to use fscanf to get data from a file "ecrire.txt": 30 lalal 50 lllll 99 kkkk Here is my code in C++ void reading(char name ){ ...
[5 replies] Last: Ganado (1892) Non, Ive not ignored your code, your code was not showe... (by heros666)
a null pointer Error
 
when i run my code i found a null pointer in the line following : TFile * file = new TFile("ResultData18JUL.root", "READ"); TIter nextkey(gDirectory->...
[5 replies] Last: it could be almost anything. you didnt check that your file opened co... (by jonnin)
file processing
 
hey everyone, i am having trouble with this project. I have gotten off to a small start, but don't really know if i am in in or going in the right direction...
[4 replies] Last: I agreed with dhayden about getting a bit more organized. #include <... (by Manga)
by eMSi21
C++ Windows Forms Themes?
 
Hello, Today I started learning Windows Forms (C++ of course), and I saw a lot of people using themes but only for C#/VB.NET. Are there any themes for C++? I...
[2 replies] Last: If the themes are in a dll then you can easily reference them. However... (by Thomas1965)
Can't access private member functions through friend function
 
Hi everyone, I don't understand why the compiler keeps saying there's an error when I tried to access the "put" function from my overloaded operator "<<". Co...
[17 replies] Last: Finally the explanation! I was thinking that "inaccessible" wasn't a n... (by tpb)
Iteration using for loop
 
Hey! I am a beginner in C++ and I am trying to build a code where the count value input by the user will decrement (if input value is 10, then: 10,9,8,7,6,5,4,3...
[5 replies] Last: Got it, works now!! Thank you so much. (by atreyi114)
Objects and Pointers
 
this program requires the creation of class objects that are used to store student information, grades, and find the average. It is pretty basic, and I understa...
[5 replies] Last: #include <iostream> #include <fstream> using namespace std; class... (by KeaganM)
by tpb
Coordinate Compression
 
We're getting kind of sick of these stupid codechef problems here.
[no replies]
by Kai456
Enum in combination with switch - help
 
I'm trying to write a simple program that uses user input to call different cases of a switch, which print different elements of an enum. As far as I could tell...
[9 replies] Last: Also it seems I didn't have to include <limits> for numeric_limits! ... (by tpb)
No entiendo el Error
 
hola como andan ,no entiendo porque me salen este 49 13 ISO C++ forbids comparison between pointer and integer [-fpermissive],me gustaria saber si podria ayuda...
[2 replies] Last: muchas gracias, ahora si puede ver mi problemas donde estaba (by alcaponesxx)
char of array and string
 
i try to print user input , only even and odd words. input : hacker rank output : hce akr rn ak but seems i misunderstood about string and array of char in ...
[2 replies] Last: #include <iostream> #include <string> using namespace std; int mai... (by Manga)
how do i connect different files together?
 
I created a new file and put a function inside and i call in from the main.cpp file but it keeps telling me that there is a undefined reference.i even compiled ...
[4 replies] Last: his line 12 would be in a .h file Karakuik. It is OK how he did it, b... (by jonnin)
August 2018 Pages: 1... 89101112... 15
  Archived months: [jul2018] [sep2018]

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