int idEgor = computeID("Egor"); int idPavel = computeID("Pavel");
#include <stdio.h> #include <stdlib.h> struct UID { char *name; unsigned short id; }*PUID; int main(int argc, char *argv[]) { int i; struct UID uid; char *names[] = {"Egor", "Alex", "Mixail", "Sergey", "Igor"}; srand(time()); for(i = 0; i < 5; i++) { uid.name = names[i]; uid.id = i + rand() % 10; printf("uid.name: %s\nuid.id: %d\n", uid.name, uid.id); } system("PAUSE"); return 0; }