Driver to test functions of printnum.c (do not modify)
More...
#include <stdio.h>
#include <stdlib.h>
#include "printnum.h"
|
static void | usage () |
|
static int | getArg (char *arg) |
|
int | main (int argc, char *argv[]) |
|
|
char * | digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
|
This is a driver program to test the functions defined in printnum.h and implemented in printnum.c.
◆ getArg()
static int getArg |
( |
char * |
arg | ) |
|
|
static |
Get int value from argument, allowing binary input like 0b0111001
- Parameters
-
arg | string containing value (decimal, octal, hex, binary) |
- Returns
- value
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Entry point of the program
- Parameters
-
argc | count of arguments, will always be at least 1 |
argv | array of parameters to program argv[0] is the name of the program, so additional parameters will begin at index 1. |
- Returns
- 0 the Linux convention for success.
◆ usage()
Print a usage statement, then exit the program returning a non-zero value, the Linux convention indicating an error
◆ digits
char* digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" |
A string of characters representing the digits to output for a particular value. Defined in the file testPrint.c
.