Yup
.
Type: Posts; User: Federal102
Yup
.
eg
bool isPrime(int num)
{
//psuedo code;
if(num is prime)
return true;
Couple of points.
1. Your code does not display primes - it displays integer values incremented by 2 each time.
2. << is a binary operator that takes an ostream& as the first argument and your...
You were very close...
Just move fout("ass2.run") to the top of your code (between main and int n), and replace all of your couts with fout. This will write your triangle to the file.
.h is non standard
To do this the "C++" way you should use std::string instead of char *.
Something like this..
#include <iostream> //DO NOT USE .h headers
#include <string>
using namespace std;
Another very simple way to do this would be to read in the lines and insert each one into a std::set. If the insertion succeeds print out the line. If the insertion fails (sets do not allow...