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_p3 [Protocol Engineering Lab.]

User Tools

Site Tools


c_p3
/* p3.c: pointer example */
 
#include <stdio.h>
 
int main(void) {
    int *ip;
    int *ip2;
    int a[10];
 
    ip = &a[3];
    ip2 = ip + 1;
 
    *ip2 = 4;
    *(ip + 1) = 5;
    printf("%d %d\n", *ip, *ip2);
 
    *(ip + 3) = 7;
    *(ip - 2) = 4;
    printf("%d %d\n", a[6], a[1]);
 
    ip = ip + 1; // ip += 1; ip++
    printf("%p %p\n", ip, ip2);
 
    return(0);
}
c_p3.txt · Last modified: 2015/02/07 07:56 by jonghyouk