Beginners - September 2018 (Page 8)

GCD problem
 
Given a list of numbers, how do I find out the minimum number of numbers to remove to make sure that the gcd of the remaining numbers are greater than what it a...
[8 replies] Last: Nah, it's only a hard problem if your input is an arbitrarily large nu... (by helios)
How to write recursive functions in iterative way
 
Let's begin with an example from CLRS int gcdex(int a,int b,int &x,int &y) { int d,dp,xp,yp; if(b==0) { d = a; x = 1;...
[1 reply] : Well, are you going to show us how to write it? (by keskiverto)
by Lilil
Need help understanding arrays.
 
Hello, I have this code here I need help understanding from homework assignment. #include <iostream> using namespace std; int main(void) { int paus...
[4 replies] Last: Sadly, that's not correct @srivats. You had better look up what sizeof... (by lastchance)
switch and if
 
i'm a beginner programmer and was trying out this array based program, it aint working the way i want it to work; could someone help me and tell me what is wron...
[1 reply] : well, it helps if you tell us what is broken. but I see this issue r... (by jonnin)
Lost Code
 
hello, I am new to programming and c++. I am currently programming on my mac on linux server and i ran into an issue. I don't know what I did to get this, and i...
[5 replies] Last: the image, don't use the nano text editor, download a c plus plus ide ... (by srivats)
by Ak619
Question about argv error checking with string
 
I want to check if the input in argv is contains only the arguments in this array char validCharacters = ".,‐+eE0123456789"; For instance argv is only val...
[4 replies] Last: Yes, I'm having suspicions about an XY problem, @jonnin. (by lastchance)
ReadFile fails
 
Hello all. I'm trying to read file in chunks using Windows API ReadFile() but it fails for some reason when hexadecimal value "00" is met in process of reading...
[6 replies] Last: @Thomas1965 solution worked perfectly, many thanks! (by mondixon)
Problem to use the Eigen header
 
Hi every body I am new in C++, and I am trying to use Eigen with very simple code. I firstly tried with the code #include <iostream> #include <Eigen/...
[3 replies] Last: Thank you I see. I put n_e instead of ne. (by sam0916)
by DellXT
HALP.
 
[7 replies] Last: @jonnin I think it might me OP's classmate or the person he's supposed... (by H00G0)
by Haniya
user login in c++
 
i am making a login form but it is not comparing the user input values to the values in the file correctly here is my code int login() { int cho...
[1 reply] : admin<<matchuser<<matchpass; admin is an ifstream. Why do you try t... (by Thomas1965)
Equilateral triangle with arrays
 
Write a program that will display an equilateral triangle with a height depending on the user. The minimum height is 1, the maximum height is 10. Use an array t...
[9 replies] Last: why can't I create a new topic? (by closed account 9G3v5Di1)
get and set
 
iam so lost with the get and set functions . please someone help! #include<iostream> #include<iomanip> using namespace std; class HealthProfile { ...
[1 reply] : first of all, as their names imply, Getters are public methods used... (by Aceix)
by dms99
Translator to Pig latin program
 
So I've been trying to implement a program that translates a word/sentence (inputed by the user) from english into pig latin and vice versa. A Pig Latin word is...
[no replies]
Sieve of Eratosthenes
 
Using the Sieve of Eratosthenes algorithm, determine the prime numbers in [0, kN] as well as the number of primes and the max prime. I've managed to get the p...
[2 replies] Last: Thank you so much for your help. I've managed to get it to print the m... (by AbleMotionz)
BMI output
 
my output doesnt show for the bmi .please help. #include<iostream> using namespace std; int main() { string name; double age;...
[1 reply] : nvm i saw what was wrong (by poohbear)
Why is my If Statement coming true when it's false?
 
I've tried googling but I have had no luck so far. cout << "Please enter account number and service code <s or p>" << endl; int accountNum; char...
[3 replies] Last: or, consider instead if(tolower(serviceCode) == 's') (by jonnin)
Using Base + Offset to grab 4 chars as an int
 
I have a char array called 'mem' sized to 100 Bytes. I'm trying to use "base address + offset" to access different parts of my simulated memory. I know that "me...
[4 replies] Last: Didn't I answer this already? int read_int(const void *mem, int off... (by helios)
Drawing a Diagonal
 
I'm new to this. I want this to result in a diagonal line. #include <iostream> using std::cout; using std::endl; using std::cin; int main() { cout << "In...
[4 replies] Last: At cosmicInferno, You had a correct solution except line12. for (in... (by Manga)
by nearc
question
 
what does the " *start" do? why use "temp = new(struct node); instead of temp=new node?" ty struct node { int info; struct node *next; ...
[2 replies] Last: Thank You (by nearc)
by Mfontz
Need help writing data to a file
 
I have a commercial gyro sensor that I'm trying to get data off of. By the sample code, I've been able to get the data to display in the window as it outputs it...
[3 replies] Last: Thanks for the suggestions! (by Mfontz)
September 2018 Pages: 1... 678910... 20
  Archived months: [aug2018] [oct2018]

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