Skip to content

Instantly share code, notes, and snippets.

@miknight
Created August 3, 2009 13:36
Show Gist options
  • Save miknight/160557 to your computer and use it in GitHub Desktop.
Save miknight/160557 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char* argv[]) {
char *pStrings[2];
pStrings[1] = (char*)malloc(100);
memset(pStrings[1], 0, 100);
pStrings[1][0] = 'c';
pStrings[1][1] = 'd';
pStrings[1][2] = '\0';
printf("The special character is: >%s< yahoo!\n", pStrings[1]);
printf("The special character is: >%c< yahoo!\n", pStrings[1][1]);
printf("Done\n");
return 0;
}
// Outputs:
// The special character is: >cd< yahoo!
// The special character is: >d< yahoo!
// Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment