/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
   char navn[] = "12345678";
   char tmp[5];
   int a, b;
   strncpy(tmp,navn,4);
   tmp[4]='\0';
   a = atoi(tmp);
   strncpy(tmp,navn+4,4);
   tmp[4]='\0';
   b = atoi(tmp);
   printf("a=%d b=%d\n",a,b);
}
