Skip to main content

Brief NotesC Language: Comments, Executable Expression, and Constant

This is just my note when I attended the lecture. I write this here so it will be long lasting.  :D 

[ Comment(s) ]
In C, an expression or a sentence is ended with mark ';' (semicolon).
There are two kinds of sentence. An executable and non-executable sentence. A non-executable sentence is called a comment.
A comment is used to give some explanation to the reader (human) so our code will be possibly more understandable to human to read it. As a comment, this sentence will not be executed when our code is runned.
We can write a comment like this:


The first type is using /* */. This type can contain multiple lines. It means that everything surrounded by '/*' and '*/' mark is considered as a comment.
And second type is using //. This type can only have one line. It means that everything behind that mark, as long as it is still in the same line, it will be considered as a comment.

[ Executable Expression ]
Executable expression is, as I mentioned before, a sentence which will be executed when our code is runned. This is what we do code for.

[ Literal Constant ]
There are several types of literal constant :
Integer consists of set of number, such as: -1, 0, 3, etc.
Character consists of one or more set of character(s) surrounded by mark apostrophe ('). Ex: 'a', 'G', '#', etc.
Float consists of decimal number. Ex: 3.14, 0.5, 2.54, etc;
String is a set of characters and written surrounded by " and ". It is an array of character. Ex: "you", "harmonic convergence", etc.

Comments

Popular posts from this blog

Derita Laptop Ganti: Sahabat Lama Menjadi Asing Bagiku

Sekitar satu tahun yang lalu, aku dan kakakku Mba Lala , tukeran laptop karena ada sedikit masalah dengan OS laptop mba lala, jadi aku memutuskan untuk membawanya buat dibenerin di comlabs aja. Satu tahun berlalu, hari demi hari aku lalui bersama laptop mba lala itu. Susah dan duka (susah dan duka ?) aku lalui bersama laptop toshiba hitam berkulit berudu. Ada kalanya seneng, ada kalanya juga engga. Ada kalanya dia responsif, tapi ada kalanya juga bebel ngambek engga nurut gerakan jari jemari yang bikin hati kesel. Tapi lebih dari itu, tanpa terasa ikatan batin antara aku dan laptop yang engga bisa aktifin bluetooth itu terjalin begitu kuat. Aku seolah tahu dimana letak file movie hanya mengklik ini dan itu dengan mata terpejam bahkan sambil tidur dan mimpi lelap. Aku sudah terbiasa dengan tata letak, environment, dan workspace yang terbangun didalamnya. Dan yang paling penting, laptop tipe satelite itu telah membantuku dalam menyelesaikan berbagai badai tubes dan tucil, membantuku di...

Violin Diary #1: Tanah Airku

This is my first time ever to record me playing the violin. I've been learning to play a violin for about 5-6 months by self-taught. It's pretty hard, but for me it's less hard than to play a guitar. It's not purrfect, in fact there are a lot of mistakes here and there, but I never give up, and I'll never give in. The song I play is called Tanah Airku which is one of Indonesian national song. It's beautiful if it's being played nicely. If you find that it's not beautiful enough, perhaps it's me that can't play it properly yet, for that I say sorry. hihihi...

Rendering Smoke and Flame in Cycles - Blender

Hello everyone... I'm Khan. Recently I wanna show you something great and cool: Rendering Smoke and Flame in cycles. When in the Blender's previous version, it is hard to do this rendering. We got to do something, you know, difficult. But actually I don't know how it works on the previous version because I've never done rendering smoke before. And I can say that my result is not bad enough as it is my first time to render smoke. Oke here is the tutorial. I'm sorry for my bad bad English. heheh. Just in case if it doesn't appear, here is the link: smoke tutorial