Created
September 25, 2012 20:42
-
-
Save manvscode/3784309 to your computer and use it in GitHub Desktop.
I had to convince my coworker about this. Pointers are not the same as arrays!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
char myarray[ 256]; | |
const char* mystring = "Hello my peeps."; | |
size_t array_size = sizeof(myarray); | |
size_t string_size = sizeof(mystring); | |
printf( " array size = %ld\n", array_size ); | |
printf( "string size = %ld\n", string_size ); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment