Mac Compatibility without a Mac??

Hello, I recently completed a C++ project for school that converted and 1 word into a secure password. Unfortunately, my teacher is running on a mac book, (seem like a 2013) and he requested that it would be cross platform and Mac compatible. I've completely written the script and when I tried to get iOs compatibility in Visual Studio 2015, I didn't realize I needed a Mac book running Os X. I do not have a mac book, to use, is there any other way I can make the code compatible with Mac and OsX? Otherwise would someone be kind enough to make it compatible for me?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Password complexicator
#include <iostream>
#include <fstream>
#include <stdio.h>     
#include <stdlib.h>     
#include <time.h>
#include <map>
#include <string>

std::map<char, char> myMap{ { 'a','@' },{ 'b','8' },{ 'c','c' },{ 'd','d' },{ 'e','3' },{ 'f','f' },{ 'g','g' },{ 'h','4' },{ 'i','1' },{ 'j','j' },{ 'k','k' },{'l','l'}, { 'm','m' },{ 'n','n' },{ 'o','0' },{ 'p','p' },{ 'q','q' },{ 'r','r' },{ 's','$' },{ 't','t' },{ 'u','u' },{'v', 'v' }, { 'w','w' }, { 'x','x' }, { 'y','y' }, { 'z','z' },{ 'A','@' },{ 'B','8' },{ 'C','C' },{ 'D','D' },{ 'E','3' },{ 'F','F' },{ 'G','G' },{ 'H','4' },{ 'I','1' },{ 'J','J' },{ 'K','K' },{ 'L','L' },{ 'M','M' },{ 'N','N' },{ 'O','0' },{ 'P','P' },{ 'Q','Q' },{ 'R','R' },{ 'S','$' },{ 'T','T' },{ 'U','U' },{ 'V', 'V' },{ 'W','W' },{ 'X','X' },{ 'Y','Y' },{ 'Z','Z' }
};
using namespace std;
int main()
{
	system("color 02");
	ofstream out_data("password.txt");
	srand(time(0));
	char a, b, e, h, i, o, s;
	char q[16];
	int r, p;
	r = rand();
	for (p = 01; r <= 29427; p++)
		r = rand();


	cout << "Enter word:" << "\n";
	string line;
	getline(cin, line);
	string cipher{};
		for (auto& elem : line)
		{
			cipher += myMap.find(elem)->second;
	}
	cout << "Your password is: " << "\n" << r << cipher << r << "\n";
	; ;out_data << "Your secure password:" << "\n" << r << cipher << r << "\n";
	cout << "Numbers generated on try " << p << "\n";
	cout << "Type exit to quit \n" ;
	cin >> q;
 
	
	return 0;



	;
}


Last edited on
Just comment out line 15 and it would run everywhere.
// system("color 02");
Ok, but how do I compile it so that it's usable ok Mac OS, it will always just complile to .exe
Just give the code to your teacher. If he wants to run the program he can compile it himself.
Last edited on
ok
Last edited on
No need to go into long explanations. Just say you used ISO standard C++ which will work on any platform.
closed account (48T7M4Gy)
Probably might not help much but all your teacher has to do is get Wine, the application for a mac which enables windows exe files to run.

Like peter87 writes, it's probably not good virus protection to run executables anyway, better for the teacher to compile.
Last edited on
Topic archived. No new replies allowed.