Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Here's a file that can be run as both a C program and a Python program, printing "hello world" in both cases:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
main.c:3:3: warning: missing terminating ' character
3 | '''
| ^
main.c:14:3: warning: missing terminating ' character
14 | '''
| ^
main.c:17:7: error: expected declaration specifiers or '...' before string constant
17 | print("hello world")
| ^~~~~~~~~~~~~
main.sh: line 2: ./a.out: No such file or directory
Testing if the previous output contains the string hello world
: True
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
hello world
Testing if the previous output contains the string hello world
: True
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Here's a file that can be run as both a C program and a Python program, printing "hello world" in both cases:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
main.c:3:3: warning: missing terminating ' character
3 | '''
| ^
main.c:14:3: warning: missing terminating ' character
14 | '''
| ^
main.c:17:7: error: expected declaration specifiers or '...' before string constant
17 | print("hello world")
| ^~~~~~~~~~~~~
main.sh: line 2: ./a.out: No such file or directory
Testing if the previous output contains the string hello world
: True
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
hello world
Testing if the previous output contains the string hello world
: True
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Here's a file that can be run as both a C program and a Python program, printing "hello world" in both cases:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
main.c:3:3: warning: missing terminating ' character
3 | '''
| ^
main.c:14:3: warning: missing terminating ' character
14 | '''
| ^
main.c:17:7: error: expected declaration specifiers or '...' before string constant
17 | print("hello world")
| ^~~~~~~~~~~~~
main.sh: line 2: ./a.out: No such file or directory
Testing if the previous output contains the string hello world
: True
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
hello world
Testing if the previous output contains the string hello world
: True
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Here's a file that can be run as both a C program and a Python program, printing "hello world" in both cases:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
main.c:3:3: warning: missing terminating ' character
3 | '''
| ^
main.c:14:3: warning: missing terminating ' character
14 | '''
| ^
main.c:17:7: error: expected declaration specifiers or '...' before string constant
17 | print("hello world")
| ^~~~~~~~~~~~~
main.sh: line 2: ./a.out: No such file or directory
Testing if the previous output contains the string hello world
: True
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
hello world
Testing if the previous output contains the string hello world
: True
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Write a single file that I can save as foo.c.py that I can run as either a C program or a python program, and so both will print "hello world". Specifically if I run `python foo.c.py` or `gcc foo.c.py && ./a.out` I should see "hello world" printed to the console.
Here's a file that can be run as both a C program and a Python program, printing "hello world" in both cases:
1 2 3 4 5 6 7 8 9 10 11 12 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
main.c:3:3: warning: missing terminating ' character
3 | '''
| ^
main.c:11:3: warning: missing terminating ' character
11 | '''
| ^
main.c:13:7: error: expected declaration specifiers or '...' before string constant
13 | print("hello world")
| ^~~~~~~~~~~~~
main.sh: line 2: ./a.out: No such file or directory
Testing if the previous output contains the string hello world
: True
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 | #if 0 ''' #endif #include <stdio.h> int main() { printf("hello world\n"); return 0; } #if 0 ''' #endif print("hello world") |
hello world
Testing if the previous output contains the string hello world
: True