Thank you for your interest in contributing to cpp-prime-identifier! This is a beginner-friendly C++ project that identifies prime numbers using vectors. All skill levels are welcome.
- A C++ compiler:
g++(GCC) orclang++ - C++11 or later
- Git
-
Clone the repository:
git clone https://github.com/achille010/cpp-prime-identifier.git cd cpp-prime-identifier -
Compile the project:
g++ -std=c++11 -Wall -o prime main.cpp
-
Run it:
./prime
| File | Purpose |
|---|---|
main.cpp |
Entry point — runs the prime identification logic |
mod.cpp |
Modular arithmetic helper |
gcd.cpp |
Greatest Common Divisor implementation |
prime-factorization.cpp |
Prime factorization logic |
- Check Issues first to avoid duplicates.
- Open a new issue with:
- A clear description of the bug
- Steps to reproduce it
- Your compiler version (
g++ --version) - Expected vs. actual output
Open an issue tagged enhancement describing:
- What you'd like to add (e.g. Sieve of Eratosthenes, benchmarking, new algorithm)
- Why it would improve the project
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes and test them locally.
-
Commit with a clear message:
git commit -m "Add: Sieve of Eratosthenes implementation" -
Push and open a Pull Request against
main:git push origin feature/your-feature-name
To keep the codebase consistent:
- Use 4 spaces for indentation (no tabs)
- Keep function names in
camelCaseorsnake_case— be consistent within a file - Add a brief comment above each function explaining what it does:
// Returns true if n is a prime number bool isPrime(int n) { ... }
- Prefer
std::vectorover raw arrays where applicable - Compile and test with
-Wall -Wextrabefore submitting — no warnings allowed
- ✨ Implement the Sieve of Eratosthenes for faster prime generation
- 📊 Add performance benchmarking between different approaches
- 🧪 Add unit tests
- 📝 Improve or add a README with examples and output
- 🐛 Fix any compiler warnings
Feel free to open an issue or contact @achille010 via GitHub. Beginners are very welcome — don't hesitate to ask!