In response to this question:
This works correctly for me on Ubuntu, and produces the same output each time I run it.
Compile with:
gcc c.c -lssl -lcrypto -o c
Run with:
// | |
// Code fragment based on http://stackoverflow.com/q/11515064/827263 | |
// | |
int main() | |
{ | |
cout << "Do you want to add, subtract, multiply or divide? I want to : " << endl; | |
cin >> ans; |
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
if (scalar @ARGV == 0 or $ARGV[0] eq '-h' or $ARGV[0] eq '-help') { | |
die "Usage: $0 pattern [file...]\n"; | |
} | |
my $pattern = shift; |
hello | |
hello.ali | |
hello.o |
In response to this question:
This works correctly for me on Ubuntu, and produces the same output each time I run it.
Compile with:
gcc c.c -lssl -lcrypto -o c
Run with:
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); |
http://stackoverflow.com/questions/13855582/gcc-outputs-very-large-executable-for-mersenne-program
This is a copy of a small C program that prints the largest(?) known Mersenne prime from http://bellard.org/mersenne.html. The file size is slightly larger than the 438 bytes mentioned on the web page, probably because of line breaks.
The original version generates a very large object file because of the large initialized static array.
#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; | |
} |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#define MAX 36 | |
#define URANDOM_DEVICE "/dev/urandom" | |
static FILE *urandom; | |
/* |
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 . . . | |
> |