Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
using namespace std;
int agenext (int age);
int main ()
{
int age = 42;
cout << "age = " << age << "\n";
agenext(age);
@Keith-S-Thompson
Keith-S-Thompson / post.txt
Created August 26, 2013 17:43
Google Groups mangles followups
From nobody Mon Aug 26 10:42:03 2013
X-Received: by 10.224.13.136 with SMTP id c8mr16375654qaa.0.1377533997489;
Mon, 26 Aug 2013 09:19:57 -0700 (PDT)
X-Received: by 10.50.80.78 with SMTP id p14mr380876igx.6.1377533997453; Mon,
26 Aug 2013 09:19:57 -0700 (PDT)
Path: eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!fx3no4866766qab.0!news-out.google.com!he10ni3708qab.0!nntp.google.com!fx3no4866762qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 26 Aug 2013 09:19:57 -0700 (PDT)
In-Reply-To: <[email protected]>
Complaints-To: [email protected]
@Keith-S-Thompson
Keith-S-Thompson / trivial.c
Created April 30, 2013 20:39
Trivial FILE example
#include <stdio.h>
int main(void) {
FILE *f;
}
@Keith-S-Thompson
Keith-S-Thompson / clc.txt
Created March 26, 2013 19:15
Google Groups quoting ruins comp.lang.c article
From: Myth__Buster <[email protected]>
Subject: Re: Macro for setting MSB - Intended to work on both Little and Big-endian machines
Newsgroups: comp.lang.c
Date: Tue, 26 Mar 2013 11:07:21 -0700 (PDT)
On Tuesday, March 26, 2013 11:36:34 AM UTC-4, Keith Thompson wrote:
> Myth__Buster <[email protected]> writes:
>
> > *was at the LS-bit of LS-byte like on little-endian machine . . .
>
@Keith-S-Thompson
Keith-S-Thompson / urandom_test.c
Created February 4, 2013 02:38
Generate random numbers from /dev/urandom
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define MAX 36
#define URANDOM_DEVICE "/dev/urandom"
static FILE *urandom;
/*
#include <stdio.h>
int main(void) {
char c[] = "abcd";
c[0] = 'E';
c[1] = 'F';
c[2] = 'G';
c[3] = 'H';
puts(c);
return 0;
}
@Keith-S-Thompson
Keith-S-Thompson / foo.adb
Created December 13, 2012 19:00
Demo for http://stackoverflow.com/q/13851524/827263 "How to assign all elements but one in ada?"
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Foo is
Element_To_Ignore : Integer := 3;
type Array_Of_Integer is array(Positive Range <>) of Integer;
A : Array_Of_Integer := (5,3,2,6);
B : Array_Of_Integer
:= A(A'First .. Element_To_Ignore-1) &
A(Element_To_Ignore+1 .. A'Last);