CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Tech Boards
Computer Programming
Source Code & Tutorial
Zone's C Programming Tutorials #1 Printf function
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ZoneAye" data-source="post: 14535" data-attributes="member: 18741"><p>Hi everyone this is my first C Programming tutorial before we start i would like to say that if you have no programming knowledge then C is probably not the best choice for your first language i would recommend something easier like C# or vb.net but you can stick with C if you want <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /></p><p></p><p>Before we start you must have the following</p><p>any ide that you are able to develop C programs in can be Visual Studio, code blocks or Dev ++</p><p>A functional brain</p><p>spare time</p><p></p><p>IDE stands for Integrated Development Environment just so you know its basically software that allows you to program in. </p><p></p><p>You will NOT learn C in a matter of minutes,hours or weeks to learn it fully it can take months usually between 4 - 6 and can even if you do a lot of studying and are a quick learner. It can aslo take years to learn.</p><p></p><p>Anyway lets began in this Tutorial i will show you how to use the Printf function it is used to output characters to the console i will have examples below <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /></p><p></p><p>Step 1: Creating a program</p><p></p><p>So after you have installed your choice of software you want to create a console application. I will be using vs 2015 so if you have that follow what i do <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /></p><p></p><p>Click New Project</p><p>then you will get a pop up</p><p>Name your program and where it says Location choose where you want the output to be <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /></p><p>If you are using any vs apart from 2010 you will have to un tick Se<u>c</u>urity Development Lifecycle (SDL) checks if you don't your program may mess up.</p><p></p><p></p><p>step 2: creating your first program</p><p>so when you do that and load your program up you should get a bit of code named</p><p></p><p>int main()</p><p>{</p><p> </p><p> return 0;</p><p>}</p><p></p><p>This is called a block of code or a function every thing you do in a C program must be linked to this function in some way you can just ignore the #include "stdafx.h" that's just apart of the C library so the compiler actually knows you are using C.</p><p></p><p>so all we are going to out put to the console is the words "Hello World". To do this we use the printf function. I i Will now show you how to do this.</p><p></p><p>int main()</p><p>{</p><p> printf("Hello World");</p><p></p><p> getchar(); </p><p></p><p>}</p><p></p><p>As you can see i do not have return 0; as we do not need it in this program.</p><p></p><p>printf is just printing the words "Hello world" to the console</p><p>getchar is waiting for the user to enter a key to close the console.</p><p></p><p>Try and see what happens if you don't use getchar();</p><p></p><p>blow are just some different ways of outputting stuff <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /></p><p></p><p>\n = new line</p><p>\t = tab</p><p>\a = audio</p><p></p><p>I would recommend testing all of these.</p><p></p><p>So guys that is my first C Programming Tutorial hope you have enjoyed reading if anyone needs help just pm me <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" /> </p><p></p><p>Next Tutorial will be on varibales <img src="/styles/default/xenforo/smilies.emoji/people/slight_smile.emoji.svg" class="smilie" loading="lazy" alt=":smile:" title="Smile :smile:" data-shortname=":smile:" /></p><p></p><p>> Zone</p></blockquote><p></p>
[QUOTE="ZoneAye, post: 14535, member: 18741"] Hi everyone this is my first C Programming tutorial before we start i would like to say that if you have no programming knowledge then C is probably not the best choice for your first language i would recommend something easier like C# or vb.net but you can stick with C if you want :grinning: Before we start you must have the following any ide that you are able to develop C programs in can be Visual Studio, code blocks or Dev ++ A functional brain spare time IDE stands for Integrated Development Environment just so you know its basically software that allows you to program in. You will NOT learn C in a matter of minutes,hours or weeks to learn it fully it can take months usually between 4 - 6 and can even if you do a lot of studying and are a quick learner. It can aslo take years to learn. Anyway lets began in this Tutorial i will show you how to use the Printf function it is used to output characters to the console i will have examples below :grinning: Step 1: Creating a program So after you have installed your choice of software you want to create a console application. I will be using vs 2015 so if you have that follow what i do :grinning: Click New Project then you will get a pop up Name your program and where it says Location choose where you want the output to be :grinning: If you are using any vs apart from 2010 you will have to un tick Se[U]c[/U]urity Development Lifecycle (SDL) checks if you don't your program may mess up. step 2: creating your first program so when you do that and load your program up you should get a bit of code named int main() { return 0; } This is called a block of code or a function every thing you do in a C program must be linked to this function in some way you can just ignore the #include "stdafx.h" that's just apart of the C library so the compiler actually knows you are using C. so all we are going to out put to the console is the words "Hello World". To do this we use the printf function. I i Will now show you how to do this. int main() { printf("Hello World"); getchar(); } As you can see i do not have return 0; as we do not need it in this program. printf is just printing the words "Hello world" to the console getchar is waiting for the user to enter a key to close the console. Try and see what happens if you don't use getchar(); blow are just some different ways of outputting stuff :grinning: \n = new line \t = tab \a = audio I would recommend testing all of these. So guys that is my first C Programming Tutorial hope you have enjoyed reading if anyone needs help just pm me :grinning: Next Tutorial will be on varibales :) > Zone [/QUOTE]
Verification
Post reply
Forums
Tech Boards
Computer Programming
Source Code & Tutorial
Zone's C Programming Tutorials #1 Printf function
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top