Using Array and Functions

Wednesday, October 7, 2009

This is the example:

#include<stdio.h>

void tulisan1(void);
void tulisan2(void);

int main(void){
    tulisan1();
    tulisan2();
}

void tulisan1(void){
    char array1[] =
    {'T','a','m','p','i','l','k','a','n','\0'};
    puts(array1);
}

void tulisan2(void){
    char array2[] = "Tampilkan";
    printf("%s\n", array2);
}


and the result is like this:

Tampilkan
Tampilkan

0 comments:

Post a Comment

 
 
Copyright © Welcome