Grotesque C tricks
-
Huh, never thought of that.
# include "sys$input"
HP C V7.3-009 on OpenVMS Alpha V8.3 says:JB> cc/war=verb i.h
include <stdio.h>
Exit
Exit
Exitinclude <stdio.h>
..^
Cannot include files in a prologue or epilogue file.
at line number 1 in file SYS$INPUT:__DECC_INCLUDE_PROLOGUE.H;
Description: It is not possible for a prologue or epilogue file to perform an #include directive. This might lead to nested inclusi
on.
User Action: Remove the #include directive from the prologue/epilogue file.(Note it takes three Ctrl-Zs to get it to work.)
JB> cc/war=verb/first=stdio.h i.h
void main(){printf("Hello, world!");}
Exit
Exit
Exit
JB> link i
JB> run i
Hello, world!
JB> -
cool :cool:
-
Pretty slick...never thought of that?
"Life can only be understood backwards, but it must be lived forward." Kierkegaard, Søren
-
Almost as a bad as a VB user I worked with on an airport project. His concept of multithreading was to how 2 programs running on the same server and commuting data between them via tcp/ip X| Luckily the error was corrected with an immediate rewrite in C++.
-
-
Neat. Works with VC++ as well. Like so:
D:\Code\vc\solos>type reader.c
#include "CON"D:\Code\vc\solos>cl /nologo reader.c
reader.c
int printf(); int main(int argc, char *argv[]) { printf("hello, world\n"); return 0; }D:\Code\vc\solos>reader.exe
hello, world-- Raj alias "Ranju" alias "gleat" http://blogorama.nerdworks.in[^] --
-
Almost as a bad as a VB user I worked with on an airport project. His concept of multithreading was to how 2 programs running on the same server and commuting data between them via tcp/ip X| Luckily the error was corrected with an immediate rewrite in C++.
actually thats a perfectly fine method of concurrency (known actually as multi-programming) his only error was using visual basic. multi-programming is a common mechanism for *nix programs (usually with a client/daemon setup, or a small program that runs and then goes away) though on *nix you wouldnt use sockets you might use pipes but more likely you just do your stuff via stdout/stdin or if you used fork() then ipc is done via shared memory. it usually faster to spawn a process in a *nix environment than, say, a windows environment. also by splitting a program into two you can make development easier, more secure (as you can have one program that needs certain permissions running under those permissions with well defined and tested interfaces)
-
Almost as a bad as a VB user I worked with on an airport project. His concept of multithreading was to how 2 programs running on the same server and commuting data between them via tcp/ip X| Luckily the error was corrected with an immediate rewrite in C++.
Since pre-.NET VB doesn't support multithreading (even using Win32 DLL imports), this is a legitimate method of concurrency.
-
-
Almost as a bad as a VB user I worked with on an airport project. His concept of multithreading was to how 2 programs running on the same server and commuting data between them via tcp/ip X| Luckily the error was corrected with an immediate rewrite in C++.
Norm .net wrote:
His concept of multithreading was to how 2 programs running on the same server and commuting data between them via tcp/ip
This could be done easily on the Commodore Amiga. Instead of using tcp/ip one used Arexx instead; the Amiga interpretation of the Rexx language.
I am the Breeg, goo goo g'joob Aici zace un om despre care nu sestie prea mult