[ create a new paste ] login | about

Link: http://codepad.org/X65JMVAL    [ raw code | output | fork ]

C, pasted on Jan 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <string.h>

int main()
{
    char temp[7];
    int i;

    memset(temp, 0, sizeof(temp));

    temp[0] = '4';
    temp[1] = '2';

    i = atoi(temp);

    printf("Foo: %s\n", temp);
    printf("Bar: %d\n", i);

    return 0;
}


Output:
1
2
Foo: 42
Bar: 42


Create a new paste based on this one


Comments: