June 13, 2013

Chapter 2 ස්පෙෂල් චාර් (Special Char)

Special Char ටිකක් අදුරගමු-

ඔයාල විවිධ වචන ටයිප් කරනකොට ඒ වගේම ජේද වවන සෙට් ටයිප් කරනකොට මෙන්න මේ මම පහලින් දාන Special Char ටික හරි වැදගත් වෙනව- 


\n - new line ( සී වලදි මේක නම් ගොඩක් ඕන වෙනව)
\b - backspace
\t - tab
\a - System bell
\\ - print \
\" - print "
\' - print '

මේ උදාහරණ ටික බලන්නකෝ - මේවගෙන් ඔයාට සිරාවටම මේ ස්පෙශල් චා ටික චා කරගන් නැතිව ගොඩ දා ගන්න පුලුවන්-

"\n"
#include<stdio.h>
int main(){
printf("Hello\nC !\n");
return 0;
}

/////////////////////////////////////////////////////////////
"\t"

#include<stdio.h>
int main(){
printf("Hello\tC !\n");
return 0;
}

//////////////////////////////////////////////////////////////
"\b"

#include<stdio.h>
int main(){
printf("Sinhalen\bC !\n");
return 0;
}

///////////////////////////////////////////////////////////////
"\" "
#include<stdio.h>
int main(){
printf("Sinhalen\"C !\n");
return 0;
}

///////////////////////////////////////////////////////////////////
Example
#include<stdio.h>
int main(){
printf("\"Correct\" way to learn C \nfrom Sinhalen C\t\\'C\'\n");
return 0;
}

කිව්වත් වගේ \n  තමයි වැඩිපුරම ඕන වෙන්නෙ

මීළග පාඩම තවත් රසවත්--------------------------------------------

මේවයේ අවුල් තියෙන තැන් කියන්න හොදේ----------




Powered By Spectra(pvt) ltd 
Established in 2012




0 comments:

Post a Comment

image

About C

C is a good language for hardware based applications and is the base of the best selling Windows OS. And is a key subject to most of the university students.

image

About us

We are students from an institute of software engineering, Sri Lanka, and we aim to make this the best blogspot for C language. Thanks!