Skip to content

Instantly share code, notes, and snippets.

@ghoomfrog
Last active June 5, 2019 02:20
Show Gist options
  • Save ghoomfrog/8369d049c32d02eb1e9c675f9af21b9c to your computer and use it in GitHub Desktop.
Save ghoomfrog/8369d049c32d02eb1e9c675f9af21b9c to your computer and use it in GitHub Desktop.
Program to get ASCII codes of characters.
#include <stdio.h>
int main(int argc, char** argv) {
// if at least an argument is given to the program
if (argc > 1) {
// loop through first argument
for (int i = 0; argv[1][i] != 0; i++)
// print integer representation of character at i
printf("%i ", argv[1][i]);
puts("");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment