Permission denied - komunikaty

0

Witam,
Dev-C++ wywala mi do poniższego kodu dwa komunikaty:

  • Permission denied
  • collect2: ld returned 1 exit status
#include <iostream>
#include <cstdlib>
#include <vector>
#include <cmath>
using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int maximum(vector<int> v);

class SitoEratostenesa
{
	private:
		bool *tab;
		
	public:
		SitoEratostenesa(int n)
		{
			tab = new bool[n + 1];
			
			for (int i = 0; i < n + 1; i++)
				tab[i] = false;
			
			for (int i = 2; i * i <= sqrt(n); i++)
			{
				if (tab[i] == true)
					continue;
				for (int j = 2 * i; j <= n; j = j+i)
					tab[j] = true;
			}
		}
		
		bool Prime(int m)
		{
			return tab[m];
		}
};

int main(int argc, char *argv[]) {
	vector<int> lista;
	vector<int>::iterator it;
	it = lista.begin();
	for (int i = 1; i < argc; i++)
	{
			int liczba = atoi(argv[i]);
			it = lista.insert(it, liczba);
	}
	
	if (lista.empty())
	{
		cout << "Nie podano żadnych argumentów";
		return 0;
	}
	
	int max = maximum(lista);
	
	SitoEratostenesa sito(max);
	
	for (int i = 1; i < argc; i++)
	{
		int liczba = atoi(argv[i]);
		bool wynik = sito.Prime(liczba);
		if (wynik == false)
			cout << liczba << " jest liczba pierwsza" << endl;
		else
			cout << liczba << " nie jest liczba pierwsza" << endl;
	}
	
	return 0;
}

int maximum(vector<int> v)
{
	vector<int>::iterator it;
	
	int max = v.front();
	
	for (it = v.begin(); it < v.end(); it++)
	{
		if (*it > max)
			max = *it;
	}
	
	return max;
}

Może mi ktoś wyjaśnić o co chodzi? I jak się tego komunikatu pozbyć?

0

Ale nie zmieniając IDE i zostając przy moim kodzie, co jest powodem tych komunikatów? :-)

1 użytkowników online, w tym zalogowanych: 0, gości: 1