Skip to content

Instantly share code, notes, and snippets.

@dafrancis
Created September 1, 2011 15:52
Show Gist options
  • Save dafrancis/1186474 to your computer and use it in GitHub Desktop.
Save dafrancis/1186474 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void wheel(char name[])
{
char *track = malloc(strlen(name));
int i, ii;
for (i = 0, ii = strlen(name) + 1; i < ii; i++) {
printf("%s:wheel:%s\n", track, name);
strcat(track, "_");
name++;
}
free(track);
}
int main(int argc, char *argv[])
{
if (argc < 2)
printf("usage: wheel [name]\n");
else
wheel(argv[1]);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment