question about getopt()

I'm using getopt() to get command line options.One the optons accepts and argument.The argument is and offset.I was wondering how can I scecify that it's argument is of the type off_t.I've something like this "offset=(off_t)optarg" and it don't work.

'optarg' is of type 'string' (char *). If 'off_t' is of type int, use atoi() to convert optarg to type off_t.