[ create a new paste ] login | about

Link: http://codepad.org/5iipaqEn    [ raw code | output | fork | 1 comment ]

C, pasted on Apr 4:
1
2
3
4
5
6
7
8
#include<stdio.h>
void main()
{
    char first_name[4] = {'A','r','y','a'};
    char last_name[5] = {'S','t','a','r','k'};
    printf("Initials: %c.%c. \n", first_name[0], last_name[0]);
    printf("First Name: %s \n", first_name);
}


Output:
1
2
Initials: A.S. 
First Name: Arya 


Create a new paste based on this one


Comments:
posted by clarkdn on Jul 6
Is this a glitch?
When I add the line:
printf("Last Name: %s", last_name)

The output says:
Last Name: StarkArya
including both the first and last names???
reply