Beginners - October 2018 (Page 12)

by Ligia
Counting the number of primes before n
 
I'm relatively new to c++, and I've been trying to write a code to count the number of primes before an arbitrary number. Can you please help me with my code? I...
[1 reply] : You can't determine that a number is prime until your inner test loop ... (by tpb)
Expected initializer before '.' token
 
I'm writing a class with an array and I'm supposed to calculate the average of some entered grades outside the class and in the main but I get the error Expec...
[10 replies] Last: Hello Brandon17, I reworked the "set" function to speed up testing. I... (by Handy Andy)
Integer not storing more than 0ne zeros in C++
 
I want to store more than one zeros in Integer #include <iostream> using namespace std; int main() { int number = 00000000; //number not storing m...
[2 replies] Last: Hi you have to use the bitset not int #include <iostream> #include ... (by saeidsj)
Iterated function system (Fractal)
 
Hello, i am stuck on my last part of assignment it say i need to write a program, named Fractal.cpp that takes a single command-line argument: the iteration le...
[1 reply] : anyone can help me (by noobcplusplusprogrammer)
by Lucky7
Hey, a beginner needs Help
 
Hey i have been given a task: Given a positive integer n. Find out if n! can be expressed as a sum of three consecutive numbers. Use a function that calculates...
[5 replies] Last: A method to check is to check if the number is equal to 1*2*3. If it's... (by Repeater)
by Satan
Does const have practical applications like reducing memory usage?
 
Okay so we know that we use the modifier 'const' when a certain variable isn't going to vary along the execution of the program. So from what I know 'const' ...
[4 replies] Last: const helps you to write better code. It actually prevents you from ab... (by coder777)
Integer to String conversion
 
I need alternative of this code #include <string> #include <iostream> # include <sstream> using namespace std; int main() { int input =1999999998; ...
[1 reply] : What kind of alternative? Maybe like that? #include <string> #includ... (by Thomas1965)
Lambda function
 
Hi everybody , I try to copy data of a vector has an other vector string hello="thelifeisbeautiful"; vector<char>life; life.resize(hel...
[11 replies] Last: @ JLBorges thank's you (by chrichri)
Am a beginner .
 
Write your question here. am a beginner here.
[5 replies] Last: Don't you guys see? By not asking a question he isn't limiting himself... (by zapshe)
Need help please!!! I am stuck
 
Good evening, I have finished my homework assignment, and my code works like a charm (with probably some minor extra unused variables lol) , but I need help cre...
[4 replies] Last: https://www.learncpp.com/cpp-tutorial/82-classes-and-class-members/ ^... (by zapshe)
vectors
 
can some tell me if im doing vector right as in the private member . im very confused how vectors work #include <iostream> #include <string> using namespace...
[4 replies] Last: @TIM's link says most of what there is to say about this. To phrase i... (by mbozzi)
help using class in program
 
Hello, I am working on a project and it seems to work really well but I would like to use a class to write the program. I have watched numerous videos on cla...
[2 replies] Last: Hi Ryan, First up, a tip for future posts: Use code tags - select you... (by TheIdeasMan)
by kmce
Pointers
 
Hi, I am going through the tutorials on here for some revision, and I am struggling to understand some code relating to pointers. This is the code // more...
[4 replies] Last: I understand now, (Not sure if I just mistyped earlier, or if I did in... (by kmce)
how do i make a program loop?
 
How do i get this program to loop, also how to make the text green? Thanks. /*Halloween program(not finished) */ #include<iostream> #include<iomanip> #inclu...
[3 replies] Last: The code: /*Halloween program(not finished) */ #include<iostream>... (by Handy Andy)
Can't Figure Out How to Write Add Fraction Function
 
I have to write a function that takes two fraction instances and adds them together. It is not allowed to be a mutation function, and it must be a const member...
[4 replies] Last: When I said you need to take care of zeros in the num /denom and handl... (by TheIdeasMan)
I need help with input validation using overloaded functions
 
For some reason I can not get the while loop in the last function to end when it is true. #include <iostream> #include <math.h> #include <iomanip> #include <...
[1 reply] : Hello vmansuria, Sorry I did not see this sooner. You not only have ... (by Handy Andy)
Carry Addition Problem in BigIntegers uptp 45 digits in c++
 
I want to take a carry if number is greater than 99999999 the digit at every index of array must be less than or equal to 99999999 Here is my code # i...
[1 reply] : I think we need more information. For example, in the code you posted,... (by dhayden)
Average value of some data
 
Hi, i must calculate arithmetic average value of some data, but when i run my program it doesn't give me any value. float arithmetic_average_value (int b ,in...
[1 reply] : You should try stepping through your code with a debugger, examining t... (by MikeyBoy)
Help with hooks
 
Hi guys, I'm very new to c++ and i recently came over problem of detecting active window change. I was using simple loop with while(1){} and GetForegroundWindow...
[4 replies] Last: Why are you using MessageBoxA instead of MessageBox It's a good idea... (by Thomas1965)
doubly linked list
 
Write your question here. #include<iostream> #include<ctime> #include<cstdlib> using namespace std; template <class T> class Node { T data;...
[2 replies] Last: I tested your code with at the the online shell and it worked fine, ev... (by nuderobmonkey)
October 2018 Pages: 1... 1011121314... 28
  Archived months: [sep2018] [nov2018]

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