User Profile
Collapse
-
Actually I think i'm beginning to understand a bit better. If i declare a vector and use the push back command to add every number produced by the factoring code, I should be able to simply access the number later using: vectorname[a number]. Can you correct me if i am wrong? -
I read that tutorial, and i think i understand what vectors do; however, i'm still not sure how to apply them to my code. Do I modify the if statement so that my xyvar variable is a vector? Even then, how do I access these numbers later?
thanks...Leave a comment:
-
array preferably..i don't even know how vectors work.
if a vector is more efficient or better in some way i'm up to learning it though.
thanks for the quick response....Leave a comment:
-
Isolating numbers in a for statement
I'm making a program which factors a number which is given by a user. I've gotten a way to output the factors using a for statement, but i would like, if possible to isolate the numbers which are given as factors so i can use them at a later time. I'm a C++ noob, so if there is a simple answer to this, don't be afraid to point it out =)
Code:#include <iostream.h> #include <math.h> using namespace std;
No activity results to display
Show More
Leave a comment: