C
1
Name:
Anonymous
2011-07-20 4:17
I'm sick of seeing the children here posting about their lisps and their pythons and what not.
Let's have a thread for a manly programming language for men like C.
2
Name:
Anonymous
2011-07-20 4:19
Go back you know where .
3
Name:
Anonymous
2011-07-20 4:26
>>2
I don't know
where . Perhaps you should go back there.
4
Name:
Anonymous
2011-07-20 4:34
I'm going to rip your dick off and rape everybody in your family with it.
5
Name:
Anonymous
2011-07-20 4:34
I'm going to rip your dick off and rape everybody in your family with it.
6
Name:
Anonymous
2011-07-20 4:35
I'm going to rip your dick off and rape everybody in your family with it.
7
Name:
Anonymous
2011-07-20 4:35
I'm going to rip your dick off and rape everybody in your family with it.
8
Name:
Anonymous
2011-07-20 4:35
I'm going to rip your dick off and rape everybody in your family with it.
9
Name:
Anonymous
2011-07-20 5:19
10
Name:
Anonymous
2011-07-20 5:26
>>9
I'm going to perform penectomy on you and use the resulting penis to sexually abuse your entire family.
11
Name:
Anonymous
2011-07-20 8:33
Pyridine instrumentation footmen Curran pump dagger. Wile synergism octile devilish MacMillan!
12
Name:
Anonymous
2011-07-20 8:59
Fatten ipso 6th synod. Pilgrimage loge crane Michelangelo pillow Rowland drawbridge gyrate baroness longstanding.
13
Name:
Anonymous
2011-07-20 9:00
Nonetheless? Chore tailor suburb FCC donate fir otter. Cassandra coleus McCormick Burundi automobile dilogarithm heterogamous stimuli?
14
Name:
Anonymous
2011-07-20 9:15
Europe arsenate subversive Atkins orb junkerdom... Axle riven hand Malaysia heft Dumpty knelt. Percept Chantilly syllogistic trepidation inaugurate rinse bedspring...
15
Name:
Anonymous
2011-07-20 11:17
I like writing reusable code, and I have a question about the use of modules (different files) in c.
I consider it bad practice, because when declaring an extern function (which is the default) the compiler can't remove it if it isn't used in a particular implementation.
So instead i put stuff in header files and declare the functions static. That way the compiler are free to inline, and remove them as it wishes.
So, how do you guys deal with this? Use the preprocessor?
Is there some magic optimization option in gcc so i don't have to do this?
16
Name:
Anonymous
2011-07-20 11:26
>>15
sorry for my fail english btw.
17
Name:
Anonymous
2011-07-20 11:40
>>15
Is there some magic optimization option in gcc so i don't have to do this?
Take a look at
-fwhole-program and
-flto .
18
Name:
Anonymous
2011-07-20 11:47
19
Name:
Anonymous
2011-07-20 12:22
Let's have a thread for a manly programming language for men like C.
It's true that from biological point of view gays are men, but I wouldn't dare to call C manly anyway.
20
Name:
Anonymous
2011-07-20 17:14
Bill simpleton. Spinach allotting cordite tomb marvelous. Improbable face McCarthy freon ninebark glossary anther indigent Katz...
21
Name:
Anonymous
2011-07-20 17:18
>>4
Philology Hopkins manse glued Davidson cartwheel checkup penicillin Sidney! McDermott fraternal resignation Cyprian. Jeremiah Jewett villain ret vicar Eaton.
22
Name:
Anonymous
2011-07-20 17:19
I wrote a program today which was half macro #definitions :)
23
Name:
Anonymous
2011-07-20 17:30
Thor scoop vitae bowel drumhead brunette! Boredom. Dangerous Gideon concurrent Venus.
24
Name:
Anonymous
2011-07-20 17:33
Cosh Offenbach runway Katmandu lesson.
25
Name:
Anonymous
2011-07-22 5:56
>>22
Fascinating, can you show us it?
26
Name:
Anonymous
2011-07-22 6:05
>>25
#define FUCK void main(){
#define YOU printf("Hello World");
#define WORLD }
FUCK YOU WORLD
27
Name:
Anonymous
2011-07-22 6:05
How is my map implementation?
#include <stdio.h>
#include <string.h>
#define MAX_STR_LEN 64
#define MAX_KEYS 1000
struct map {
int count;
char key[MAX_KEYS][MAX_STR_LEN];
char value[MAX_KEYS][MAX_STR_LEN];
};
char *map_fetch(struct map *map, char *key);
void map_store(struct map *map, char *key, char *value);
int main(void) {
struct map my_map;
my_map.count = 0;
map_store(&my_map, "sussman", "God");
map_store(&my_map, "mdickie", "artist");
map_store(&my_map, "frozen-void", "autist");
map_store(&my_map, "VIPPER", "anus");
printf("sussman-> %s\n", map_fetch(&my_map, "sussman"));
return 0;
}
char *map_fetch(struct map *map, char *key) {
int i;
for (i=0; i <= map->count; i++) {
if (!strcmp(map->key[i], key)) {
return map->value[i];
}
}
return NULL;
}
void map_store(struct map *map, char *key, char *value) {
int i = map->count;
if (i == MAX_KEYS) { return; } // silent failure is kinda lame
strcpy(map->key[i], key);
strcpy(map->value[i], value);
map->count++;
}
28
Name:
Anonymous
2011-07-22 6:18
You should use a b-tree instead of a pair of arrays.
29
Name:
Anonymous
2011-07-22 6:24
>>27
horrible, only supports strings and uses arrays.
Change that around to allow for any variable/struct type.
30
Name:
Anonymous
2011-07-22 6:38
31
Name:
Anonymous
2011-07-22 7:44
This is how a map is done, bitches:
var map = {};
map["best"] = map;
map["map"] = { anotherFreakinMap: map };
map["eva"] = map["map"].anotherFreakinMap;
32
Name:
Anonymous
2011-07-22 9:49
>>31
If it weren't for ECMAScript's
horrible type system, somebody might actually use it for
ENTERPRISE purposes
!
33
Name:
Anonymous
2011-07-22 11:58
>>32
Since when does Javascript have a type system?
34
Name:
32
2011-07-22 14:51
>>33
exactly my point!
once you've experienced the pleasure of being typed inside, you can't go back anymore
;;____;;
35
Name:
VIPPER
2011-07-22 15:02
JScript has types.
36
Name:
Anonymous
2011-07-22 15:43
>>35
so does brainfuck ...
37
Name:
Anonymous
2011-07-22 15:45
38
Name:
Anonymous
2011-07-22 15:47
Let's have a thread for a manly programming language for men like C.
Not valid C code. Also, bad form: too many upper-case characters, and token lengths are greater than 1 character.
39
Name:
Anonymous
2011-07-22 16:13
>>34
I have experienced that "pleasure", and it's very painful. I will never go back to it unless I really have to.
40
Name:
Anonymous
2011-07-22 17:00
>>27
#include <stdio.h>
#include <ooc/ooc.h>
#include <ooc/util/TreeMap.h>
int main(void) {
var myMap __attrib_local = new(TreeMap());
Map.put(myMap, "Sussman", "God");
Map.put(myMap, "You", "Interesting");
Map.put(myMap, "Me", "Conjurer of Spells");
printf("Sussman -> %s\n",
Map.get(myMap, "Sussman"));
return 0;
}
Newer Posts