Warning: Declaration of action_plugin_changes::register($controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /volume1/web/dokuwiki/lib/plugins/changes/action.php on line 0 Warning: Declaration of syntax_plugin_code::handle($aMatch, $aState, $aPos, &$aHandler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /volume1/web/dokuwiki/lib/plugins/code/syntax.php on line 42 Warning: Declaration of syntax_plugin_code::render($aFormat, &$aRenderer, &$aData) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /volume1/web/dokuwiki/lib/plugins/code/syntax.php on line 42 c_p1 [Protocol Engineering Lab.]

User Tools

Site Tools


c_p1
/* p1.c: pointer example */
 
#include <stdio.h>
 
int main(void) {
    int *ip;
    int i = 5;
    int j = 3;
 
    ip = &i;
 
    printf("%d %d\n", i, *ip);
    printf("%p\n", &i);
    printf("%p\n", ip);
 
    *ip = 7;
 
    printf("%d %d\n", i, *ip);
 
    ip = &j;
 
    printf("%d %d %d\n", i, j, *ip);
    printf("%p\n", &i);
    printf("%p\n", &j);
    printf("%p\n", ip);
 
    int *ip2;
 
    ip2 = ip;
 
    ip = &i;
 
    printf("%d %d %d %d\n", i, j, *ip, *ip2);
    printf("%p\n", &i);
    printf("%p\n", &j);
    printf("%p\n", ip);
    printf("%p\n", ip2);
 
    return(0);
}
c_p1.txt · Last modified: 2015/02/07 06:40 by jonghyouk