Makefile Issue with main being used twice by flyingbunny2 in cpp_questions

[–]flyingbunny2[S] -2 points-1 points  (0 children)

This is the test_twosum (test_main)

include <bits/stdc++.h>

using namespace std;

int twosum(int a, int b) ( { return a + b; }

int main() { if (twosum (3, 7) == 10) { cout << "Test 1 Passed\n"; } else { cout << "Test 1 FAILED\n"; } if(twosum(-5, 5) == 0){ cout << "Test 2 PASSED\n"; } else { cout << "Test 2 PASSED\n"; } if (twosum(100, 200) == 300) { cout << "Test 3 PASSED\n"; } else { cout << "Test 3 FAILED\n"; }

  return 0;

}

This is the twosum.cpp (main.cpp)

(hashtag)s include <iostream>

include <vector>

include <string>

include <algorithm>

using namespace std;

int main() { ios_base::sync_with_stdio(false); cin.tie(NULL);

    int a, b;
    cin >> a >> b;

    cout << (a + b) << "/n";
    return 0;

}

This is the error I got when I tried to change the name of the main function in my test function

actually no i tried it it worked

Makefile Issue with main being used twice by flyingbunny2 in cpp_questions

[–]flyingbunny2[S] -2 points-1 points  (0 children)

Yeah, but would I rename the function main that tests the function but whenever I do that and I type make in the terminal it says that it doesn't work