LoginPassword
Forum - Development - Leer C in 3 lessen - 1  2  >
GreyFox
System Administrator
Les 1:

Hello World!

code:
#include "stdio.h" #define e 3 #define g (e/e) #define h ((g+e)/2) #define f (e-g-h) #define j (e*e-g) #define k (j-h) #define l(x) tab2[x]/h #define m(n,a) ((n&(a))==(a)) long tab1[]={ 989L,5L,26L,0L,88319L,123L,0L,9367L }; int tab2[]={ 4,6,10,14,22,26,34,38,46,58,62,74,82,86 }; main(m1,s) char *s; { int a,b,c,d,o[k],n=(int)s; if(m1==1){ char b[2*j+f-g]; main(l(h+e)+h+e,b); printf(b); } else switch(m1-=h){ case f: a=(b=(c=(d=g)<<g)<<g)<<g; return(m(n,a|c)|m(n,b)|m(n,a|d)|m(n,c|d)); case h: for(a=f;a<j;++a)if(tab1[a]&&!(tab1[a]%((long)l(n))))return(a); case g: if(n<h)return(g); if(n<j){n-=g;c='D';o[f]=h;o[g]=f;} else{c='\r'-'\b';n-=j-g;o[f]=o[g]=g;} if((b=n)>=e)for(b=g<<g;b<n;++b)o[b]=o[b-h]+o[b-g]+c; return(o[b-g]%n+k-h); default: if(m1-=e) main(m1-g+e+h,s+g); else *(s+g)=f; for(*s=a=f;a<e;) *s=(*s<<e)|main(h+a++,(char *)m1); } }

Als jullie deze snappen hebben jullie les 2 en 3 niet meer nodig.
posted: 31-10-06 09:47edited: 31-10-2006 09:48, by GreyFox  
Castor
System Administrator
Lijkt wel een vraagstuk uit een certificatie traject

Study everything, you'll find something you can use - Jason Bourne
posted: 31-10-06 10:08  
Lionh2
Community Moderator
Het eerste stuk begrijp ik wel, maar daarna wordt het mij iets te onoverzichtelijk tbh.

Wat is het doel van de functie? Misschien heb ik dan meer houvast.
posted: 31-10-06 10:19  
bobsqaud
Rconner
Voor mij is het net chinees
posted: 31-10-06 10:30  
Stoeipoes
Member
quote:
bobsqaud Wrote:
Voor mij is het net chinees

Je moet het ook niet proberen uit te spreken
What the faq?
posted: 31-10-06 11:06  
Real1ty
DevTeam
A "hello world" program is a software program that prints out "Hello world!" on a display device. It is used in many introductory tutorials for teaching a programming language. Such a program is typically one of the simplest programs possible in a computer language. Some are surprisingly complex, especially in some graphical user interface (GUI) contexts, but most are very simple, especially those which rely heavily on a particular command line interpreter ("shell") to perform the actual output. In many embedded systems, the text may be sent to a one or two-line liquid crystal display (LCD), or some other appropriate signal, such as an LED being turned on, may substitute for the message.

A "hello world" program can be a useful sanity test to make sure that a language's compiler, development environment, and run-time environment are correctly installed. Configuring a complete programming toolchain from scratch to the point where even trivial programs can be compiled and run can involve substantial amounts of work. For this reason, a simple program is used first when testing a new tool chain.

While small test programs existed since the development of programmable computers, the tradition of using the phrase "Hello world!" as a test message was influenced by an example program in the book The C Programming Language. The example program from that book prints "hello, world" (without capital letters or exclamation sign), and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial, which contains the first known version:
quote:

main() {
printf("hello, world");
}


The first known instance of the usage of the words "hello" and "world" together in computer literature occurred earlier, in Kernighan's 1972 Tutorial Introduction to the Language B, with the following code:
quote:

main( ) {
extrn a, b, c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}
a 'hell';
b 'o, w';
c 'orld';


There are many variations on the punctuation and casing of the phrase, and the examples on this page print out several of these variations. Variations include the presence or absence of the comma and exclamation mark, and the capitalisation of the 'H', both the 'H' and the 'W', or neither. The most commonly accepted variation nowadays, despite not being the original text, is "Hello world!"[citation needed] Some languages are forced to implement different forms, such as "HELLO WORLD!," on systems that only support capital letters, while many "hello world" programs in esoteric languages print out a slightly modified string. For example, one Malbolge program prints "HEllO WORld", this having been determined to be "good enough." "Hello world" programs also normally print a newline after their message.

Erhm...ja
posted: 31-10-06 12:45  
GreyFox
System Administrator
quote:
Lionh2 Wrote:
Het eerste stuk begrijp ik wel, maar daarna wordt het mij iets te onoverzichtelijk tbh.

Wat is het doel van de functie? Misschien heb ik dan meer houvast.


Hij drukt "hello world!" af.
posted: 31-10-06 13:18  
RapidFire
Member
wat mij betreft is dit meer "leer ongelofelijk slechte C-functies schrijven in 1 les"
posted: 31-10-06 13:21  
KNz
Rconner
ook een manier om hello world te printen
posted: 31-10-06 13:27  
Vermilion
Member
Volgens mij doe je moeilijker dan nodig is
posted: 31-10-06 13:28  
Lionh2
Community Moderator
quote:
Vermilion Wrote:
Volgens mij doe je moeilijker dan nodig is



QFT!
posted: 31-10-06 13:59  
GreyFox
System Administrator
*Zucht* Volgens mij snappen mensen sarcastische nerd posts niet hier. (Tip: blijf weg van het development board, noobs. )
posted: 31-10-06 14:41  
Lionh2
Community Moderator
quote:
GreyFox Wrote:
*Zucht* Volgens mij snappen mensen sarcastische nerd posts niet hier. (Tip: blijf weg van het development board, noobs. )



Naab wij snappen het wel, maar we willen jou gewoon zien happen
posted: 31-10-06 15:38  
Leff
Advisor
http://thc.org/root/phun/unmaintain.html

Ook handig om erbij te houden
Pigeon Power!
posted: 31-10-06 17:57  
Pulse
Advisor
daar heb je mensen voor
onkruid vergaat niet zullen we maar zeggen..
posted: 02-11-06 20:08  
ProB
Rconner
Hest nou elemal de steertziekte kregen.
Godvergemie de roktok maar weer
ik gean heen.


Zo probeer dat dan maar eens te oncijferen.

als je het weet ben je les 2 t/m 604 niet meer nodig
Do u have a ProBleem, mister.
posted: 02-11-06 23:10edited: 02-11-2006 23:10, by ProB  
Lionh2
Community Moderator
quote:
ProB Wrote:
Hest nou elemal de steertziekte kregen.
Godvergemie de roktok maar weer
ik gean heen.


Zo probeer dat dan maar eens te oncijferen.

als je het weet ben je les 2 t/m 604 niet meer nodig



Volgens mij komt het erop neer dat wij jou voorlopig niet terugzien.
Het is nu al lekker rustig hiero
posted: 03-11-06 08:07  
Pulse
Advisor
quote:
ProB Wrote:
Hest nou elemal de steertziekte kregen.
Godvergemie de roktok maar weer
ik gean heen.


Zo probeer dat dan maar eens te oncijferen.

als je het weet ben je les 2 t/m 604 niet meer nodig



dat je naar een psychiater moet?
onkruid vergaat niet zullen we maar zeggen..
posted: 03-11-06 15:20  
bobsqaud
Rconner
maar waar gebruik je dit nou voor dan snap er totaal niks van ?
posted: 03-11-06 16:56  
ProB
Rconner
/cry

maar jah wat ik wilde aangeven.

Taal word je mee opgegroeid.
Of als je je ergens mee bezig houd ga je het vanzelf leren.
Do u have a ProBleem, mister.
posted: 03-11-06 17:21  
Forum - Development - Leer C in 3 lessen - 1  2  >
locked