a free c++ program

Arrgghh

Member
Nov 25, 2001
33
0
0
OK, I'll bite. By free c++ program I'm assuming you mean a compiler right? If so, just type free c++ compiler into google and you should get lots of hits.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I can write you a free C++ program if you want one, I don't guarantee it'll do much =)

Most of the free compilers you find will probably be based on gcc somehow, I would personally just use it. Find an editor you like with decent syntax highlighting, auto-indenting, etc (I like gvim, but it's not for the faint of heart) and you're good to go.
 

Jasonh100

Senior member
Apr 21, 2001
200
0
0
Yoyoyoy......... this is a program I made..... I just be stupid though so it may not work. let me know. btw, I'm a beginner at c++ so don't laugh too much

#include <iostream>
#include <ctime>

using namespace std;

int main()
{
long ArMax = 10000;

cout << "Amount of Prime #'s to calculate\n: ";
cin >> ArMax;

clock_t starttime = clock();

long *prime = new long[ArMax];

int pcount =0;
int divisible;

// Seeding
prime[0] = 1;
prime[1] = 2;
pcount = 2;


int x = 3;
int y = 0;

while ( pcount < ArMax ) {

divisible = 0;

for ( y = 0; y < pcount; y++ ) {
if (x % prime[y] == 0) divisible++;
if (divisible > 1) break;
}

if (divisible < 2) {
prime[pcount]=x;
pcount++;
}
x++;

}

cout << "Time: " << clock()-starttime << " ms\n\n";
return 0;
}
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
nothinman's offer is pretty weak, you think he'd offer a cool C program like THIS. :p

Ok, so its mostly (all?) C instead of C++ but as C is a subset of C++... ;)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
What are you getting at? You described 1 language, so you're use of 'any' is ambiguous and one poster even posted source code to a simple C++ program.
 

MustPost

Golden Member
May 30, 2001
1,923
0
0
<<A non-<I>free</I> alternative to GCC>>

Finding a none free alternitive is easy, a free one is harder.