MB·3, Downloads. related to C# Programming Language in this eBook C#. portal7.info C in Hindi Kuldeep Chand C in Hindi. C programming language tutorial in hindi: Index. जैसे जैसे topic आगे बढेगा, यहाँ पर उसके link add होते रहेंगे. प्रारंभ करने से पहले. C in Hindi portal7.info Kuldeep Chand Learn . learning “C” Language, you can't learn any Modern Programming Language.
|Language:||English, Spanish, Hindi|
|Genre:||Health & Fitness|
|ePub File Size:||29.43 MB|
|PDF File Size:||14.70 MB|
|Distribution:||Free* [*Sign up for free]|
C in Hindi. portal7.info Kuldeep Chand. Learn Programming Fundamentals with Deep Details in easy to understand Hindi Language. C Language in Hindi: वास्तव में आज जितनी भी Modern Programming Languages उपलब्ध हैं, वे सभी “C” Language पर ही आधारित हैं।. Download कीजिये Basic Programming Language "C" की PDF बिलकुल free में. आज मै आपको बताना चाहूँगा की आज जितने.
Python Tutorial for Beginners PDF Python Programming Characteristics It provides rich data types and easier to read syntax than any other programming languages It is a platform independent scripted language with full access to operating system API's Compared to other programming languages, it allows more run-time flexibility It includes the basic text manipulation facilities of Perl and Awk A module in Python may have one or more classes and free functions Libraries in Pythons are cross-platform compatible with Linux, Macintosh, and Windows For building large applications, Python can be compiled to byte-code Python supports functional and structured programming as well as OOP It supports interactive mode that allows interacting Testing and debugging of snippets of code In Python, since there is no compilation step, editing, debugging and testing is fast. Python Programming Python is commonly used by programmers to: Program video games Program various scientific programs such as statistical models In these Python tutorials, we will cover Python 2 and Python 3 Examples.
C language was invented for implementing UNIX operating system…. Steps to be followed for any C program to create and get the output are explained. This is common to all C programs and there is no exception, whether its a very small C program or very large program.
Structure of a C program is defined by a set of rules called protocol, to be followed by programmer while writing a C program… more….
C data types are defined as the data storage format that a variable can store a data to perform a specific operation. Data types are used to define a variable before using in a program.
Size of variable, const and array are determined by data types. There are four data types in the C language. They are…. C tokens, Identifiers and Keywords are the basics in a C program.
All are explained in this page with definition and simple example programs. C tokens are the basic building blocks in C language which are constructed together to write a C program. Each program element in a C program is given a name called identifiers….
C Constants are also like normal variables. Constants refer to fixed values. They are also called as literals. Constants may be belonging to any of the data type…. C variable is a named location in a memory where a program can manipulate the data.
This location is used to hold the value of the variable. The value of the C variable may get changed in the program. The C variable might be belonging to any of the data types like int, float, char etc…. The symbols which are used to perform logical and mathematical operations in a C program are called C operators.
These C operators join individual constants and variables to form expressions. Operators, functions, constants and variables are combined together to form expressions…. In decision control statements C — if else and nested if , group of statement is executed when the condition is true. If the condition is false, then, else part statements are executed. In C programming, there are 3 types of decision making control statements in C language.
Loop control statements in C programming are used to perform looping operations until the given condition is true. Control comes out of the loop statements once the condition becomes false.
The program prints "hello, world" to the standard output , which is usually a terminal or screen display. The original version was: A standard-conforming "hello, world" program is: The first line of the program contains a preprocessing directive , indicated by include. This causes the compiler to replace that line with the entire text of the stdio. The angle brackets surrounding stdio.
The next line indicates that a function named main is being defined. The main function serves a special purpose in C programs; the run-time environment calls the main function to begin program execution. The type specifier int indicates that the value that is returned to the invoker in this case the run-time environment as a result of evaluating the main function, is an integer.
The keyword void as a parameter list indicates that this function takes no arguments.
The opening curly brace indicates the beginning of the definition of the main function. The next line calls diverts execution to a function named printf , which in this case is supplied from a system library.
The string literal is an unnamed array with elements of type char , set up automatically by the compiler with a final 0-valued character to mark the end of the array printf needs to know this.
The return value of the printf function is of type int , but it is silently discarded since it is not used. A more careful program might test the return value to determine whether or not the printf function succeeded.
The semicolon ; terminates the statement. The closing curly brace indicates the end of the code for the main function.
Formerly an explicit return 0; statement was required. This is interpreted by the run-time system as an exit code indicating successful execution. Integer type char is often used for single-byte characters. C99 added a boolean datatype. There are also derived types including arrays , pointers , records struct , and unions union. C is often used in low-level systems programming where escapes from the type system may be necessary.
The compiler attempts to ensure type correctness of most expressions, but the programmer can override the checks in various ways, either by using a type cast to explicitly convert a value from one type to another, or by using pointers or unions to reinterpret the underlying bits of a data object in some other way.
Some find C's declaration syntax unintuitive, particularly for function pointers. Ritchie's idea was to declare identifiers in contexts resembling their use: C's usual arithmetic conversions allow for efficient code to be generated, but can sometimes produce unexpected results. For example, a comparison of signed and unsigned integers of equal width requires a conversion of the signed value to unsigned. This can generate unexpected results if the signed value is negative.
C supports the use of pointers , a type of reference that records the address or location of an object or function in memory. Pointers can be dereferenced to access data stored at the address pointed to, or to invoke a pointed-to function.
Pointers can be manipulated using assignment or pointer arithmetic. The run-time representation of a pointer value is typically a raw memory address perhaps augmented by an offset-within-word field , but since a pointer's type includes the type of the thing pointed to, expressions including pointers can be type-checked at compile time.
Pointer arithmetic is automatically scaled by the size of the pointed-to data type. Pointers are used for many purposes in C. Text strings are commonly manipulated using pointers into arrays of characters. Dynamic memory allocation is performed using pointers. Many data types, such as trees , are commonly implemented as dynamically allocated struct objects linked together using pointers.
Pointers to functions are useful for passing functions as arguments to higher-order functions such as qsort or bsearch or as callbacks to be invoked by event handlers.
A null pointer value explicitly points to no valid location. Dereferencing a null pointer value is undefined, often resulting in a segmentation fault. Null pointer values are useful for indicating special cases such as no "next" pointer in the final node of a linked list , or as an error indication from functions returning pointers.
In appropriate contexts in source code, such as for assigning to a pointer variable, a null pointer constant can be written as 0 , with or without explicit casting to a pointer type, or as the NULL macro defined by several standard headers.
In conditional contexts, null pointer values evaluate to false, while all other pointer values evaluate to true. Since the size and type of the pointed-to object is not known, void pointers cannot be dereferenced, nor is pointer arithmetic on them allowed, although they can easily be and in many contexts implicitly are converted to and from any other object pointer type.
Careless use of pointers is potentially dangerous. Because they are typically unchecked, a pointer variable can be made to point to any arbitrary location, which can cause undesirable effects. Although properly used pointers point to safe places, they can be made to point to unsafe places by using invalid pointer arithmetic ; the objects they point to may continue to be used after deallocation dangling pointers ; they may be used without having been initialized wild pointers ; or they may be directly assigned an unsafe value using a cast, union, or through another corrupt pointer.
In general, C is permissive in allowing manipulation of and conversion between pointer types, although compilers typically provide options for various levels of checking. Some other programming languages address these problems by using more restrictive reference types.
Array types in C are traditionally of a fixed, static size specified at compile time. The more recent C99 standard also allows a form of variable-length arrays. However, it is also possible to allocate a block of memory of arbitrary size at run-time, using the standard library's malloc function, and treat it as an array. C's unification of arrays and pointers means that declared arrays and these dynamically allocated simulated arrays are virtually interchangeable.
Since arrays are always accessed in effect via pointers, array accesses are typically not checked against the underlying array size, although some compilers may provide bounds checking as an option. If bounds checking is desired, it must be done manually. C does not have a special provision for declaring multi-dimensional arrays , but rather relies on recursion within the type system to declare arrays of arrays, which effectively accomplishes the same thing. The index values of the resulting "multi-dimensional array" can be thought of as increasing in row-major order.
Multi-dimensional arrays are commonly used in numerical algorithms mainly from applied linear algebra to store matrices. The structure of the C array is well suited to this particular task. However, since arrays are passed merely as pointers, the bounds of the array must be known fixed values or else explicitly passed to any subroutine that requires them, and dynamically sized arrays of arrays cannot be accessed using double indexing.
A workaround for this is to allocate the array with an additional "row vector" of pointers to the columns. C99 introduced "variable-length arrays" which address some, but not all, of the issues with ordinary C arrays.
Furthermore, in most expression contexts a notable exception is as operand of sizeof , the name of an array is automatically converted to a pointer to the array's first element. This implies that an array is never copied as a whole when named as an argument to a function, but rather only the address of its first element is passed.
Therefore, although function calls in C use pass-by-value semantics, arrays are in effect passed by reference. The latter only applies to array names: However, arrays created by dynamic allocation are accessed by pointers rather than true array variables, so they suffer from the same sizeof issues as array pointers.
Thus, despite this apparent equivalence between array and pointer variables, there is still a distinction to be made between them. Even though the name of an array is, in most expression contexts, converted into a pointer to its first element , this pointer does not itself occupy any storage; the array name is not an l-value , and its address is a constant, unlike a pointer variable.
Consequently, what an array "points to" cannot be changed, and it is impossible to assign a new address to an array name. Array contents may be copied, however, by using the memcpy function, or by accessing the individual elements.
One of the most important functions of a programming language is to provide facilities for managing memory and the objects that are stored in memory. C provides three distinct ways to allocate memory for objects: These three approaches are appropriate in different situations and have various trade-offs.
For example, static memory allocation has little allocation overhead, automatic allocation may involve slightly more overhead, and dynamic memory allocation can potentially have a great deal of overhead for both allocation and deallocation.
The persistent nature of static objects is useful for maintaining state information across function calls, automatic allocation is easy to use but stack space is typically much more limited and transient than either static memory or heap space, and dynamic memory allocation allows convenient allocation of objects whose size is known only at run-time.
Most C programs make extensive use of all three. Where possible, automatic or static allocation is usually simplest because the storage is managed by the compiler, freeing the programmer of the potentially error-prone chore of manually allocating and releasing storage. However, many data structures can change in size at runtime, and since static allocations and automatic allocations before C99 must have a fixed size at compile-time, there are many situations in which dynamic allocation is necessary.
See the article on malloc for an example of dynamically allocated arrays. Unlike automatic allocation, which can fail at run time with uncontrolled consequences, the dynamic allocation functions return an indication in the form of a null pointer value when the required storage cannot be allocated.
Static allocation that is too large is usually detected by the linker or loader , before the program can even begin execution. Unless otherwise specified, static objects contain zero or null pointer values upon program startup. Automatically and dynamically allocated objects are initialized only if an initial value is explicitly specified; otherwise they initially have indeterminate values typically, whatever bit pattern happens to be present in the storage , which might not even represent a valid value for that type.
If the program attempts to access an uninitialized value, the results are undefined. Many modern compilers try to detect and warn about this problem, but both false positives and false negatives can occur. Another issue is that heap memory allocation has to be synchronized with its actual usage in any program in order for it to be reused as much as possible.
For example, if the only pointer to a heap memory allocation goes out of scope or has its value overwritten before free is called, then that memory cannot be recovered for later reuse and is essentially lost to the program, a phenomenon known as a memory leak.
Conversely, it is possible for memory to be freed but continue to be referenced, leading to unpredictable results. Typically, the symptoms will appear in a portion of the program far removed from the actual error, making it difficult to track down the problem. Such issues are ameliorated in languages with automatic garbage collection.
The C programming language uses libraries as its primary method of extension. In C, a library is a set of functions contained within a single "archive" file. Each library typically has a header file , which contains the prototypes of the functions contained within the library that may be used by a program, and declarations of special data types and macro symbols used with these functions.
In order for a program to use a library, it must include the library's header file, and the library must be linked with the program, which in many cases requires compiler flags e. The most common C library is the C standard library , which is specified by the ISO and ANSI C standards and comes with every C implementation implementations which target limited environments such as embedded systems may provide only a subset of the standard library.
Standard library and run-time system[ edit ] Main article: Standard library Most programming languages have an associated core library sometimes known as the 'standard library', especially if it is included as part of the published language standard , which is conventionally made available by all implementations of the language.
Core libraries typically include definitions for commonly used algorithms, data structures, and mechanisms for input and output. The line between a language and its core library differs from language to language. In some cases, the language designers may treat the library as a separate entity from the language.
However, a language's core library is often treated as part of the language by its users, and some language specifications even require that this library be made available in all implementations. Indeed, some languages are designed so that the meanings of certain syntactic constructs cannot even be described without referring to the core library.
For example, in Java , a string literal is defined as an instance of the java. String class; similarly, in Smalltalk , an anonymous function expression a "block" constructs an instance of the library's BlockContext class. Conversely, Scheme contains multiple coherent subsets that suffice to construct the rest of the language as library macros, and so the language designers do not even bother to say which portions of the language must be implemented as language constructs, and which must be implemented as parts of a library.
Design and implementation[ edit ] Programming languages share properties with natural languages related to their purpose as vehicles for communication, having a syntactic form separate from its semantics, and showing language families of related languages branching one from another. A significant difference is that a programming language can be fully described and studied in its entirety, since it has a precise and finite definition. While constructed languages are also artificial languages designed from the ground up with a specific purpose, they lack the precise and complete semantic definition that a programming language has.
Many programming languages have been designed from scratch, altered to meet new needs, and combined with other languages. Many have eventually fallen into disuse.
Although there have been attempts to design one "universal" programming language that serves all purposes, all of them have failed to be generally accepted as filling this role. Programmers range in expertise from novices who need simplicity above all else, to experts who may be comfortable with considerable complexity. Programs must balance speed, size, and simplicity on systems ranging from microcontrollers to supercomputers. Programs may be written once and not change for generations, or they may undergo continual modification.
Programmers may simply differ in their tastes: they may be accustomed to discussing problems and expressing them in a particular language. One common trend in the development of programming languages has been to add more ability to solve problems using a higher level of abstraction. The earliest programming languages were tied very closely to the underlying hardware of the computer.
As new programming languages have developed, features have been added that let programmers express ideas that are more remote from simple translation into underlying hardware instructions. Because programmers are less tied to the complexity of the computer, their programs can do more computing with less effort from the programmer. This lets them write more functionality per time unit.