Skip to main content

Brief Notes C Language: Term and Program Structure

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

[ The Terms in C ]
There are several terms used in C:
Block is a set of expression written between '{' and '}' mark;
Definition tells the property(ies) of an object and allocate the object's memory as well;
Declaration tells the property(ies) of an object especially related to type;
Initialization gives the initial value to the object;
Global Declaration is the declaration which is valid in one unit translation (file);
Local Declaration is the declaration which is only valid in one block this declaration placed;
Object also known as a variable;
Lvalue is an expression that refers to an object. Easily, lvalue is the left value of an assignment expression;
Body is the realization of a function;
Scope is a program's area where name is known.

[ Program's Structure ]
Below is the structure of a main program written in C:



Actually there is no such a strict role in the matter of character's position.
For more clear example, it will be written here in my next post as I will keep posting about C. :D
Thank you for coming.
Leave a comment, if you want to. :D

Comments

Popular posts from this blog

[Arduino Project -- 5] -- Using Keypad and LCD Screen at Once to make simple Calculator

Good day. This is my fifth times of my post about Arduino. We've learned about how to create something using Arduino from the very beginning that was just make a simple push button, till we made something more difficult which was creating a temperature censor and displaying the result in the LCD screen. And now, i'm gonna show you how to use a keypad and LCD Screen at once. With these two devices are combined with our Arduino, we are able to make something like a little application. And now, i'm gonna make a simple calculator using them. Stuffs: These are stuffs you are gonna need to prepare An Arduino Uno A BreadBoard Jumper Cables A Keypad A PC which has Arduino App Installed A Potensiometer A Resistor What do we do? First thing we gotta do is to wire our Arduino and keypad as shown below: Actually we dont need the speaker and the led. But I put them when i wired them. And here is my work: It was a little bit confusing i thought. And aft

[Arduino Project-2] -- Lampu Fade in - Fade out dengan PWM

Good Day, Semoga hari-hari selalu menjadi hari baik bagi kita semua. Masih kesengsem sama Arduino, pada postingan kali ini saya akan menjelaskan (kalau bisa disebut) mempraktikan cara membuat lampu LED yang bisa nyala terang dan gelap (fade-in / fade-out ) dengan PWM. Yang akan kita lakukan adalah membuat lampu LED berubah tingkat terangnya (brightness). Sebelumnya kita perlu tahu apa itu PWM. PWM atau Pulse Width Modulation adalah teknik yang dilakukan untuk mengubah tingkat ke terang an (brightness) LED dengan cara mengatur waktu delay. Jika kita memberikan delay pada LED dengan Arduino maka lampu tersebut akan berkedip. Akan tetapi jika delay sangat cepat, maka lampu tersebut terlihat tidak berkedip lagi, melainkan kita bisa mengatur tingkat terang (brightness) lampu tersebut. Jika delay yang sangat cepat tersebut diturunkan kecepatannya sedikit, maka yang terlihat adalah brightness lampu yang turun. Begitu pula sebaliknya. Jika membingungkan, Anda tidak perlu mengingatnya. Baiklah

[Arduino Project-1] -- PushButton Lamp

Apa sih Arduino? Salam, Pada posting kali ini akan menjelaskan tentang tugas kuliah Interaksi Manusia dengan Komputer dan Antar Muka, yaitu membuat lampu push button menggunakan Arduino. Saya anggap pembaca telah mengetahui apa itu arduino. Jika belum tahu, akan saya jelaskan sedikit. Arduino bisa dikatakan sebagai alat untuk membuat sebuah prototye. Kita bisa  membuat apapun (hampir apapun) dengan menggunakan arduino. Seperti membuat sensor panas/dingin,bahkan hingga membuat robot. Arduino sebenarnya diperuntukkan bagi para artist maupun designer yang memerlukan kemudahan dalam merancang produk yang hendak mereka buat. Jadi, untuk menggunakannya tidak diperlukan keterampilan khusus yang tinggi karena di design untuk kemudahan (tentunya setelah tahu dasar-dasarnya). Seperti apa sih Arduino itu? Di bawah ini gambarnya Image Source: https://dlnmh9ip6v2uc.cloudfront.net//images/products/1/1/0/2/1/11021-01a.jpg Arduino ada banyak jenisnya yang bisa dilihat di