Dev C Tutorial

Posted on by
Dev C Tutorial Rating: 7,2/10 6937 votes

C Tutorial PDF Version Quick Guide Resources Job Search Discussion C programming is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. I'm new to win32 application building using C. I'm using DEV C and I'm able to get a window, by using the 'windows application' icon in DEV. I want to know how to display our text on to the window??? Win32 api is the MS-Windows operating system functions, all programs that run under MS-Windows. PDF Version Quick Guide Resources Job Search Discussion. C programming is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system. C is the most widely used computer language. Dev-C Tutorial for CSC 161 Students (Maintained by Mike Serrano) Bloodshed!? I'll be the first to say that the name Bloodshed won't give you warm and fuzzies, but I think it's best if.

  • C++ Basics
  • C++ Object Oriented
  • C++ Advanced
  • C++ Useful Resources
  • Selected Reading

C/C++ arrays allow you to define variables that combine several data items of the same kind, but structure is another user defined data type which allows you to combine data items of different kinds.

Tutorial

Structures are used to represent a record, suppose you want to keep track of your books in a library. You might want to track the following attributes about each book −

  • Title
  • Author
  • Subject
  • Book ID

Defining a Structure

To define a structure, you must use the struct statement. The struct statement defines a new data type, with more than one member, for your program. The format of the struct statement is this −

The structure tag is optional and each member definition is a normal variable definition, such as int i; or float f; or any other valid variable definition. At the end of the structure's definition, before the final semicolon, you can specify one or more structure variables but it is optional. Here is the way you would declare the Book structure −

Accessing Structure Members

To access any member of a structure, we use the member access operator (.). The member access operator is coded as a period between the structure variable name and the structure member that we wish to access. You would use struct keyword to define variables of structure type. Following is the example to explain usage of structure −

When the above code is compiled and executed, it produces the following result −

Structures as Function Arguments

You can pass a structure as a function argument in very similar way as you pass any other variable or pointer. You would access structure variables in the similar way as you have accessed in the above example −

When the above code is compiled and executed, it produces the following result −

Pointers to Structures

You can define pointers to structures in very similar way as you define pointer to any other variable as follows −

Now, you can store the address of a structure variable in the above defined pointer variable. To find the address of a structure variable, place the & operator before the structure's name as follows −

To access the members of a structure using a pointer to that structure, you must use the -> operator as follows −

Let us re-write above example using structure pointer, hope this will be easy for you to understand the concept −

When the above code is compiled and executed, it produces the following result −

The typedef Keyword

There is an easier way to define structs or you could 'alias' types you create. For example −

Now, you can use Books directly to define variables of Books type without using struct keyword. Following is the example −

You can use typedef keyword for non-structs as well as follows −

x, y and z are all pointers to long ints.

  • C Programming Tutorial
  • C Programming useful Resources
  • Selected Reading

When we say Input, it means to feed some data into a program. An input can be given in the form of a file or from the command line. C programming provides a set of built-in functions to read the given input and feed it to the program as per requirement.

When we say Output, it means to display some data on screen, printer, or in any file. C programming provides a set of built-in functions to output the data on the computer screen as well as to save it in text or binary files.

The Standard Files

C programming treats all the devices as files. So devices such as the display are addressed in the same way as files and the following three files are automatically opened when a program executes to provide access to the keyboard and screen.

Standard FileFile PointerDevice
Standard inputstdinKeyboard
Standard outputstdoutScreen
Standard errorstderrYour screen

The file pointers are the means to access the file for reading and writing purpose. This section explains how to read values from the screen and how to print the result on the screen.

The getchar() and putchar() Functions

The int getchar(void) function reads the next available character from the screen and returns it as an integer. This function reads only single character at a time. You can use this method in the loop in case you want to read more than one character from the screen.

The int putchar(int c) function puts the passed character on the screen and returns the same character. This function puts only single character at a time. You can use this method in the loop in case you want to display more than one character on the screen. Check the following example −

When the above code is compiled and executed, it waits for you to input some text. When you enter a text and press enter, then the program proceeds and reads only a single character and displays it as follows −

The gets() and puts() Functions

The char *gets(char *s) function reads a line from stdin into the buffer pointed to by s until either a terminating newline or EOF (End of File).

The int puts(const char *s) function writes the string 's' and 'a' trailing newline to stdout.

Dev C++ Tutorial Area Of Rectangle

NOTE: Though it has been deprecated to use gets() function, Instead of using gets, you want to use fgets().

When the above code is compiled and executed, it waits for you to input some text. When you enter a text and press enter, then the program proceeds and reads the complete line till end, and displays it as follows −

The scanf() and printf() Functions

The int scanf(const char *format, ..) function reads the input from the standard input stream stdin and scans that input according to the format provided.

Dev C Debug Tutorial

The int printf(const char *format, ..) function writes the output to the standard output stream stdout and produces the output according to the format provided.

The format can be a simple constant string, but you can specify %s, %d, %c, %f, etc., to print or read strings, integer, character or float respectively. There are many other formatting options available which can be used based on requirements. Let us now proceed with a simple example to understand the concepts better −

When the above code is compiled and executed, it waits for you to input some text. When you enter a text and press enter, then program proceeds and reads the input and displays it as follows −

Jun 06, 2017  Native Instruments Massive Vst Plugin Free Download Latest Version for Fl studio. Native Instruments Massive 1.3 free download for windows.It is full offline installer standalone setup of Native Instruments Massive plugin for 32/64 bit PC. Native Instruments Massive is a great music production software/plugin for Electronic. Massive.dll download. The Massive.dll file is a dynamic link library for Windows 10, 8.1, 8, 7, Vista and XP. You can fix 'The file Massive.dll is missing.' Recommended Download: Massive.dll Repair Tool. This repair tool is designed to diagnose your Windows PC problems and repair them quickly. It scans your PC, identifies the problem areas and fixes them completely. Jul 12, 2019  Massive X Native Instruments Jan/2020 – V1.2.0 (Updated) 64-bit: VST, VST3 and AAX Win Vista, 7, 8, 10 Instructions: Attached Direct Download (970MB). Oct 25, 2018  Massive Native Instruments 1.5.5 (VST / VST3, AAX, Standalone) Windows 8 and 10 32-bit and 64-bit Direct Download (171MB). Massive dll vst download mac.

Dev C++ Tutorial For Beginners In Hindi

Here, it should be noted that scanf() expects input in the same format as you provided %s and %d, which means you have to provide valid inputs like 'string integer'. If you provide 'string string' or 'integer integer', then it will be assumed as wrong input. Secondly, while reading a string, scanf() stops reading as soon as it encounters a space, so 'this is test' are three strings for scanf().