Commit 6cb9838e authored by Karine's avatar Karine

Exercise_05_25, Version1

parent 9daac871
exercise_05_25: main.o | .gitignore
g++ $^ -o $@
main.ii: main.cpp
g++ -E $^ -o $@
main.s: main.ii
g++ -S $^ -o $@
main.o: main.s
g++ -c $^ -o $@
.gitignore:
echo "exercise_05_25" > $@
clean:
rm *.ii *.s *.o *.out exercise_05_25 .gitignore
test: exercise_05_25
@./exercise_05_25 > test.out
@diff test.out test.expected > /dev/null 2>&1 && echo PASSED || echo FAILED
.PRECIOUS: main.ii main.s
.SECONDARY: main.ii main.s
#include <iostream>
int
main()
{
int counter;
for (counter = 1; counter < 5; ++counter) {
std::cout << counter << " ";
}
std::cout << std::endl
<< "Broke out of loop at count = "
<< counter
<< std::endl;
return 0;
}
In this example we can change continue* condition i < 5 instead of i <= 10 and it will
break out at 5.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment