All pastes #781687 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-18 23:27 UTC
rendered paste body
/* glob.h */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#define LOGIN_SIZE 16
#define TOT_USERS 3

struct user {
	char login[LOGIN_SIZE];
};

extern struct user users[TOT_USERS];



/* ------------------------------------------ */
/* ent.c */
#include "glob.h"

struct user users[TOT_USERS];

void initialize();

int main () {
	initialize();
	printf("ent: %s\n", users[0].login);
	sleep(10);
	exit(0);
}

void initialize() {
	strcpy(users[0].login, "one");
	strcpy(users[1].login, "two");
	strcpy(users[2].login, "three");
	return;
}



/* ------------------------------------------ */
/* ver.c */
#include "glob.h"

struct user users[TOT_USERS];

int main () {
	printf("ver: %s\n", users[0].login);
	exit(0);
}