Parent directory
Makefile
hello.cpp
CC = g++
CXX = g++
CFLAGS = -g -Wall
CXXFLAGS = -g -Wall -std=c++20
hello: hello.o
hello.o: hello.cpp
.PHONY: clean
clean:
rm -f *.o hello
.PHONY: all
all: clean hello
#include <iostream>
namespace c2cpp {
int main() {
using namespace std;
string s;
s = "hello ";
s = s + "world ";
// Shouldn't the following line be the same thing?
// s = "hello " + "world ";
// What about this?
// s = s + 100;
// Or this?
// s += 100; // Try changing 100 to 101 to see what's going on
cout << s << "c" << 2 << "cpp!" << endl;
return 0;
}
} // namespace c2cpp
int main() {
return c2cpp::main();
}