1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include "log_macros.h"
int main(int argc, char* argv[]) {
char s4[] = { 0x37, 0x35, 0x00 }; // "75"
// char* a_c1 = s4[1]; // WRONG
// └┘
// s4 is a char[3].
// s4[1] is char.
char* a_c1 = &s4[1];
log_char( *a_c1 );
log_addr( a_c1 );
char** a_a_c1 = &a_c1;
log_addr( a_a_c1 );
return EXIT_SUCCESS;
}
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */
|
© Copyright 2023 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.