No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
/*Write a program which will print all the pairs of prime numbers whose sum equals the number entered by the user. */ #include <iostream> #include <vector> using namespace std; int main() { int maxNum; bool prime = true; cin >> maxNum; vector <int> primeSequence; for(int i = 1; i <= … | |
Hi all! I'm having some trouble with constructors and destructors. I've been told that a constructor creates an object and a destructor destroys it. The problem is that in my code I try to destroy `straight2`, but I can still print out it's length as if it wasn't destroyed at … |