JIMS Vasant Kunj-II is one of the best BCA colleges in Delhi NCR. The Course content provided to BCA students are well updated and as per the Demand of the IT Industry. It helps to get Placements in Top IT Companies.
This Pdf includes the Details of File Handling in C. This comes in Unit IV.
BCA Department of JIMS Vasant Kunj-II, teaches C language in Semester 1. Here Dr. Arpana Chaturvedi shares the concept of Two Dimensional Array. It is in Unit II.
JIMS VasantKunj-II is one of the bestBCACollegeinDelhiNCR. The Course Content of BCA is as per the technology in demand and well updated.
There are two types of Arrays, in this pdf, a two-dimensional array is described. The Document explains well the concept with examples of Two Dimensional Array
BCA, Department of Information Technology and Software Development teaches Java and Advanced Java in the Third and Fifth semesters. The best part of the Department faculties is to teach the software in the latest tool, which is used by the IT Experts in the software Companies. We teach Java and Advance Java in Eclipse, Net Beans, and IntelliJ.
JIMS Vasant Kunj-II provides the best BCA Course. This is one of the best BCA colleges in Delhi NCR. The admissions 2022 is open and interested students can apply.
www.jimssouthdelhi.com
We at JIMS Vasant Kunj-II use the latest tools to use all the latest languages we included in the curriculum.
Our BCA Curriculum is well updated as per the Industry Demand and standards.
BCA, JIMS Vasant Kunj-II teaches C language to First Semester students. In this pdf, you can read the fundamentals of Array. JIMS Vasant Kunj-II is one of the best BCA colleges in Delhi NCR with an updated Curriculum.
This document provides an introduction to using R Studio for statistical analysis. It discusses how to install both R and R Studio on Windows and Mac systems. It then covers creating scripts and files in R Studio, basic R syntax including assigning values to variables, vectors, and strings. The document also demonstrates how to install and load packages to access additional functions, and how to access built-in datasets to practice working with data in R.
This document provides an introduction and overview of standard library functions in C++. It discusses different header files like stdio.h, string.h, math.h, iostream.h, and ctype.h that contain commonly used functions. Examples of functions from each header file are listed, such as functions for input/output, string manipulation, mathematical operations, and character classification. Specific string and character related functions like isalpha, isdigit, toupper, and tolower are also explained with examples.
This document provides an introduction to the Python programming language. It discusses Python language elements like literals, keywords, identifiers, operators, expressions, statements, and comments. It also covers Python data types, variables, printing values, and how to write and run a simple Python program. The document aims to explain Python concepts in a step-by-step manner to help readers learn the basics of the Python language.
R is a programming language and environment for statistical analysis and graphics. It has many built-in statistical and graphical techniques. R can be installed from CRAN and runs on Windows, MacOS, and UNIX systems. The basic R interface is the console, but RStudio provides an integrated development environment. In RStudio, you can write scripts, see outputs and plots, and access help and packages. Packages extend R's functionality through additional functions and data. Common data types in R include numeric, integer, character, factor, and logical. Vectors are the basic data structure, but R also supports matrices, arrays, data frames and lists.
This document discusses abstract data types and encapsulation. It explains that abstract data types define a set of objects, operations on those objects, and encapsulate them so the user cannot directly access the hidden data. Encapsulation through subprograms and type definitions is described. Different approaches to static and dynamic storage management like stacks, heaps, and garbage collection are also summarized.
BCA Department of JIMS Vasant Kunj-II, teaches C language in Semester 1. Here Dr. Arpana Chaturvedi shares the concept of Two Dimensional Array. It is in Unit II.
JIMS VasantKunj-II is one of the bestBCACollegeinDelhiNCR. The Course Content of BCA is as per the technology in demand and well updated.
There are two types of Arrays, in this pdf, a two-dimensional array is described. The Document explains well the concept with examples of Two Dimensional Array
BCA, Department of Information Technology and Software Development teaches Java and Advanced Java in the Third and Fifth semesters. The best part of the Department faculties is to teach the software in the latest tool, which is used by the IT Experts in the software Companies. We teach Java and Advance Java in Eclipse, Net Beans, and IntelliJ.
JIMS Vasant Kunj-II provides the best BCA Course. This is one of the best BCA colleges in Delhi NCR. The admissions 2022 is open and interested students can apply.
www.jimssouthdelhi.com
We at JIMS Vasant Kunj-II use the latest tools to use all the latest languages we included in the curriculum.
Our BCA Curriculum is well updated as per the Industry Demand and standards.
BCA, JIMS Vasant Kunj-II teaches C language to First Semester students. In this pdf, you can read the fundamentals of Array. JIMS Vasant Kunj-II is one of the best BCA colleges in Delhi NCR with an updated Curriculum.
This document provides an introduction to using R Studio for statistical analysis. It discusses how to install both R and R Studio on Windows and Mac systems. It then covers creating scripts and files in R Studio, basic R syntax including assigning values to variables, vectors, and strings. The document also demonstrates how to install and load packages to access additional functions, and how to access built-in datasets to practice working with data in R.
This document provides an introduction and overview of standard library functions in C++. It discusses different header files like stdio.h, string.h, math.h, iostream.h, and ctype.h that contain commonly used functions. Examples of functions from each header file are listed, such as functions for input/output, string manipulation, mathematical operations, and character classification. Specific string and character related functions like isalpha, isdigit, toupper, and tolower are also explained with examples.
This document provides an introduction to the Python programming language. It discusses Python language elements like literals, keywords, identifiers, operators, expressions, statements, and comments. It also covers Python data types, variables, printing values, and how to write and run a simple Python program. The document aims to explain Python concepts in a step-by-step manner to help readers learn the basics of the Python language.
R is a programming language and environment for statistical analysis and graphics. It has many built-in statistical and graphical techniques. R can be installed from CRAN and runs on Windows, MacOS, and UNIX systems. The basic R interface is the console, but RStudio provides an integrated development environment. In RStudio, you can write scripts, see outputs and plots, and access help and packages. Packages extend R's functionality through additional functions and data. Common data types in R include numeric, integer, character, factor, and logical. Vectors are the basic data structure, but R also supports matrices, arrays, data frames and lists.
This document discusses abstract data types and encapsulation. It explains that abstract data types define a set of objects, operations on those objects, and encapsulate them so the user cannot directly access the hidden data. Encapsulation through subprograms and type definitions is described. Different approaches to static and dynamic storage management like stacks, heaps, and garbage collection are also summarized.
Workshop presentation hands on r programmingNimrita Koul
This document provides an overview of the R programming language. It discusses that R is an environment for statistical computing and graphics. It includes conditionals, loops, user defined functions, and input/output facilities. The document describes how to download and install R and RStudio. It also covers key R features such as objects, classes, vectors, matrices, lists, functions, packages, graphics, and input/output.
Lex is a program that generates scanners or tokenizers to recognize lexical patterns in text. Yacc is a parser generator for Unix systems that generates code for a parser in C. Together, Lex tokenizes input strings while Yacc parses the tokenized input provided by Lex. Lexical analysis analyzes a stream of characters into a sequence of lexical tokens like words and punctuation to feed into the parser.
This document provides an introduction to using Lex and Yacc to build compilers. Lex is used to generate a lexical analyzer from input patterns, which converts strings to tokens. Yacc generates a parser from a grammar, which analyzes tokens to build a syntax tree. The document describes building a calculator as an example, which can be converted to a compiler by changing the code generation. It also discusses additional Lex and Yacc features like strings, reserved words, debugging, recursion, and attributes.
Spark and Resilient Distributed Datasets addresses the need for efficient data sharing across iterative and interactive queries in large clusters. It proposes an in-memory data processing framework called Spark, using a distributed data structure called Resilient Distributed Datasets (RDDs) that allow data to be cached in memory across jobs. RDDs act as a fault-tolerant distributed shared memory, avoiding the need to write to stable storage between jobs and enabling more efficient data sharing compared to MapReduce.
A short tutorial on R, basically for a starter who wants to do data mining especially text data mining.
Related codes and data will be found at the following lnik: http://textanalytics.in/wm/R%20tutorial%20(DATA2014).zip
The document discusses primitive data types including data objects, values, value types, data types, primitive data types, numeric data types, subrange types, enumeration types, boolean types, character types, declarations, binding, type checking, type equivalence, type conversion, coercion, and initialization. It explains that data objects store data values and have attributes like value type and size. There are primitive and composite value types. Data types classify data and include primitive, numeric, subrange, enumeration, boolean, and character types. Declarations specify a variable's data type and name. Binding describes how variables are created and used. Type checking and equivalence ensure correct data types in operations. Type conversion and coercion change a value's type. Initialization
The document provides an overview of yacc (Yet Another Compiler Compiler), which is a tool that parses a stream of tokens according to a user-specified grammar. It describes the structure of a yacc file, which includes definitions, rules, and code sections. It also discusses how yacc interacts with lex to generate tokens, and how values can be returned from lex to yacc using the yylval variable. An example calculator program is provided to demonstrate how yacc can be used to parse arithmetic expressions by defining grammar rules and associating actions with parsing steps.
The presentation is a brief case study of R Programming Language. In this, we discussed the scope of R, Uses of R, Advantages and Disadvantages of the R programming Language.
R is a programming language developed as an alternative for S at AT&T Bell Laboratories. It excels at statistical computation and graphic visualization. R is free, open source, and available across platforms. It has over 3,000 packages on CRAN that extend its functionality. R has a steep learning curve and working with large datasets is limited by RAM size. Major companies use R in business.
This document discusses different data structures and algorithms. It provides examples of common data structures like arrays, linked lists, stacks, queues, trees, and graphs. It describes what each data structure is, how it stores and organizes data, and examples of its applications. It also discusses abstract data types, algorithms, and how to analyze the time and space complexity of algorithms.
Lex is a program generator designed for lexical processing of character input streams. It works by translating a table of regular expressions and corresponding program fragments provided by the user into a program. This program then reads an input stream, partitions it into strings matching the given expressions, and executes the associated program fragments in order. Flex is a fast lexical analyzer generator that is an alternative to Lex. It generates scanners that recognize lexical patterns in text based on pairs of regular expressions and C code provided by the user.
Lexical analysis is the first step in compiler construction and involves breaking a program into individual tokens. A Lex program has three sections: declarations, translation rules, and auxiliary code. The declarations section defines regular expressions and global variables. The translation rules section matches regular expressions to tokens and executes C code actions. When a regular expression is matched in the input stream, its corresponding action is executed to return the appropriate token.
The document discusses Lex and Yacc, which are programs that generate lexical analyzers and parsers. Lex uses regular expressions to generate a scanner that tokenizes input into tokens, while Yacc uses context-free grammars to generate a parser that analyzes tokens based on syntax rules. The document provides examples of how Lex and Yacc can be used together, with Lex generating tokens from input that are then passed to a Yacc-generated parser to build a syntax tree based on the grammar.
This document discusses data types and data structures. It defines them and describes their key attributes. For data types, it covers specification, implementation, operations and examples of elementary types. For data structures, it discusses composition, organization, representation and implementation of operations. It also addresses type equivalence checking, conversion and lists several common data structures like arrays, records, lists and files.
The document provides an overview of runtime environments and data representation in memory. It discusses how different data types like integers, floats, characters, and pointers are represented in memory. It also describes how arrays, structs, objects, and instructions are laid out and accessed in memory. Additionally, it covers different storage classes like global, static, local, and dynamic variables and how they are implemented using memory segments like the stack, heap, and data segments. It concludes by explaining the structure of the runtime stack and stack frames.
Sparql semantic information retrieval byIJNSA Journal
Semantic web document representation is formulated using RDF/OWL. RDF representation is in the form
of triples & OWL in form of ontologies. The above representation leads to a data set which needs to be
queried using software agents, machines. W3C has recommended SPARQL to be the de facto query
language for RDF. This paper proposes to suggest a model to enable SPARQL to make search efficient,
easier and produce meaningful search distinguished on the basis of preposition. An RDF data source
primarily consist of data that is represented in the form of a Triple pattern which has an appropriate RDF
syntax and further results into an RDF Graph .The RDF repository stores the Data on Subject, Predicate,
Object Model. The Predicate may also be thought of as a property linking the Subject and Object. This
paper shall evaluate the information retrieval by incorporating preposition as property.
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 1)Binary Studio
ANTLR 4 is a parser generator that can generate parsers from language grammars specified in EBNF notation. It automatically generates classes for traversing the syntax tree and has powerful error recovery. ANTLR 4 supports generating parsers for Java, C#, Python and other languages from grammar files. It works by lexing input into tokens, parsing the tokens according to the grammar, and building a syntax tree that can then be traversed using listeners or visitors.
Python Programming - XII. File ProcessingRanel Padon
The document discusses file handling and processing in Python. It covers opening and closing files, different file open modes like read, write and append, parsing files, buffering, and random access files. Common file operations like reading, writing, splitting and stripping file contents are demonstrated. The document also provides examples of parsing HTML and CSV files, using files with classes, and serializing objects for efficient storage and transfer.
This document provides an introduction to R, an open-source programming language for statistical analysis and graphics. R was created in the 1990s at the University of Auckland and is now developed by a core team. It allows users to analyze data, create visualizations, and perform statistical modeling. The document outlines how to set up the R environment locally on Windows and Linux systems and describes key R features such as its programming language, data types, graphical capabilities, and useful third-party resources.
COURSE TITLE: SOFTWARE DEVELOPMENT VI
COURSE CODE: VIT 351
TOPICS COVERED:
FILES
FILES I/O STREAM
TYPES OF FILES
DRAWBACKS OF TRADITIONAL METHOD OF DATA STORAGE
CONCEPT OF BUFFER
MODES OF FILE OPENING
END OF FILE
PROCESSORS DIRECTIVES
MACROS
TYPES OF MACROS
DIFFERENCE BETWEEN MACROS AND FUNCTIONS
QUIZ SET 5
This document discusses file handling in Python. It begins by explaining that files allow permanent storage of data, unlike standard input/output which is volatile. It then covers opening files in different modes, reading files line-by-line or as a whole, and modifying the file pointer position using seek(). Key points include opening files returns a file object, reading can be done line-by-line with for loops or using read()/readlines(), and seek() allows changing the file pointer location.
File management functions in C allow programs to work with files. They provide functions to open, read, write, and close files. Some key functions include fopen() to open a file, fread() and fwrite() to read from and write to files, and fclose() to close a file. Files can be opened in different modes like read, write, append depending on whether the file needs to be read from or written to. Command line arguments allow passing of inputs to a program from the command line when it is launched.
Workshop presentation hands on r programmingNimrita Koul
This document provides an overview of the R programming language. It discusses that R is an environment for statistical computing and graphics. It includes conditionals, loops, user defined functions, and input/output facilities. The document describes how to download and install R and RStudio. It also covers key R features such as objects, classes, vectors, matrices, lists, functions, packages, graphics, and input/output.
Lex is a program that generates scanners or tokenizers to recognize lexical patterns in text. Yacc is a parser generator for Unix systems that generates code for a parser in C. Together, Lex tokenizes input strings while Yacc parses the tokenized input provided by Lex. Lexical analysis analyzes a stream of characters into a sequence of lexical tokens like words and punctuation to feed into the parser.
This document provides an introduction to using Lex and Yacc to build compilers. Lex is used to generate a lexical analyzer from input patterns, which converts strings to tokens. Yacc generates a parser from a grammar, which analyzes tokens to build a syntax tree. The document describes building a calculator as an example, which can be converted to a compiler by changing the code generation. It also discusses additional Lex and Yacc features like strings, reserved words, debugging, recursion, and attributes.
Spark and Resilient Distributed Datasets addresses the need for efficient data sharing across iterative and interactive queries in large clusters. It proposes an in-memory data processing framework called Spark, using a distributed data structure called Resilient Distributed Datasets (RDDs) that allow data to be cached in memory across jobs. RDDs act as a fault-tolerant distributed shared memory, avoiding the need to write to stable storage between jobs and enabling more efficient data sharing compared to MapReduce.
A short tutorial on R, basically for a starter who wants to do data mining especially text data mining.
Related codes and data will be found at the following lnik: http://textanalytics.in/wm/R%20tutorial%20(DATA2014).zip
The document discusses primitive data types including data objects, values, value types, data types, primitive data types, numeric data types, subrange types, enumeration types, boolean types, character types, declarations, binding, type checking, type equivalence, type conversion, coercion, and initialization. It explains that data objects store data values and have attributes like value type and size. There are primitive and composite value types. Data types classify data and include primitive, numeric, subrange, enumeration, boolean, and character types. Declarations specify a variable's data type and name. Binding describes how variables are created and used. Type checking and equivalence ensure correct data types in operations. Type conversion and coercion change a value's type. Initialization
The document provides an overview of yacc (Yet Another Compiler Compiler), which is a tool that parses a stream of tokens according to a user-specified grammar. It describes the structure of a yacc file, which includes definitions, rules, and code sections. It also discusses how yacc interacts with lex to generate tokens, and how values can be returned from lex to yacc using the yylval variable. An example calculator program is provided to demonstrate how yacc can be used to parse arithmetic expressions by defining grammar rules and associating actions with parsing steps.
The presentation is a brief case study of R Programming Language. In this, we discussed the scope of R, Uses of R, Advantages and Disadvantages of the R programming Language.
R is a programming language developed as an alternative for S at AT&T Bell Laboratories. It excels at statistical computation and graphic visualization. R is free, open source, and available across platforms. It has over 3,000 packages on CRAN that extend its functionality. R has a steep learning curve and working with large datasets is limited by RAM size. Major companies use R in business.
This document discusses different data structures and algorithms. It provides examples of common data structures like arrays, linked lists, stacks, queues, trees, and graphs. It describes what each data structure is, how it stores and organizes data, and examples of its applications. It also discusses abstract data types, algorithms, and how to analyze the time and space complexity of algorithms.
Lex is a program generator designed for lexical processing of character input streams. It works by translating a table of regular expressions and corresponding program fragments provided by the user into a program. This program then reads an input stream, partitions it into strings matching the given expressions, and executes the associated program fragments in order. Flex is a fast lexical analyzer generator that is an alternative to Lex. It generates scanners that recognize lexical patterns in text based on pairs of regular expressions and C code provided by the user.
Lexical analysis is the first step in compiler construction and involves breaking a program into individual tokens. A Lex program has three sections: declarations, translation rules, and auxiliary code. The declarations section defines regular expressions and global variables. The translation rules section matches regular expressions to tokens and executes C code actions. When a regular expression is matched in the input stream, its corresponding action is executed to return the appropriate token.
The document discusses Lex and Yacc, which are programs that generate lexical analyzers and parsers. Lex uses regular expressions to generate a scanner that tokenizes input into tokens, while Yacc uses context-free grammars to generate a parser that analyzes tokens based on syntax rules. The document provides examples of how Lex and Yacc can be used together, with Lex generating tokens from input that are then passed to a Yacc-generated parser to build a syntax tree based on the grammar.
This document discusses data types and data structures. It defines them and describes their key attributes. For data types, it covers specification, implementation, operations and examples of elementary types. For data structures, it discusses composition, organization, representation and implementation of operations. It also addresses type equivalence checking, conversion and lists several common data structures like arrays, records, lists and files.
The document provides an overview of runtime environments and data representation in memory. It discusses how different data types like integers, floats, characters, and pointers are represented in memory. It also describes how arrays, structs, objects, and instructions are laid out and accessed in memory. Additionally, it covers different storage classes like global, static, local, and dynamic variables and how they are implemented using memory segments like the stack, heap, and data segments. It concludes by explaining the structure of the runtime stack and stack frames.
Sparql semantic information retrieval byIJNSA Journal
Semantic web document representation is formulated using RDF/OWL. RDF representation is in the form
of triples & OWL in form of ontologies. The above representation leads to a data set which needs to be
queried using software agents, machines. W3C has recommended SPARQL to be the de facto query
language for RDF. This paper proposes to suggest a model to enable SPARQL to make search efficient,
easier and produce meaningful search distinguished on the basis of preposition. An RDF data source
primarily consist of data that is represented in the form of a Triple pattern which has an appropriate RDF
syntax and further results into an RDF Graph .The RDF repository stores the Data on Subject, Predicate,
Object Model. The Predicate may also be thought of as a property linking the Subject and Object. This
paper shall evaluate the information retrieval by incorporating preposition as property.
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 1)Binary Studio
ANTLR 4 is a parser generator that can generate parsers from language grammars specified in EBNF notation. It automatically generates classes for traversing the syntax tree and has powerful error recovery. ANTLR 4 supports generating parsers for Java, C#, Python and other languages from grammar files. It works by lexing input into tokens, parsing the tokens according to the grammar, and building a syntax tree that can then be traversed using listeners or visitors.
Python Programming - XII. File ProcessingRanel Padon
The document discusses file handling and processing in Python. It covers opening and closing files, different file open modes like read, write and append, parsing files, buffering, and random access files. Common file operations like reading, writing, splitting and stripping file contents are demonstrated. The document also provides examples of parsing HTML and CSV files, using files with classes, and serializing objects for efficient storage and transfer.
This document provides an introduction to R, an open-source programming language for statistical analysis and graphics. R was created in the 1990s at the University of Auckland and is now developed by a core team. It allows users to analyze data, create visualizations, and perform statistical modeling. The document outlines how to set up the R environment locally on Windows and Linux systems and describes key R features such as its programming language, data types, graphical capabilities, and useful third-party resources.
COURSE TITLE: SOFTWARE DEVELOPMENT VI
COURSE CODE: VIT 351
TOPICS COVERED:
FILES
FILES I/O STREAM
TYPES OF FILES
DRAWBACKS OF TRADITIONAL METHOD OF DATA STORAGE
CONCEPT OF BUFFER
MODES OF FILE OPENING
END OF FILE
PROCESSORS DIRECTIVES
MACROS
TYPES OF MACROS
DIFFERENCE BETWEEN MACROS AND FUNCTIONS
QUIZ SET 5
This document discusses file handling in Python. It begins by explaining that files allow permanent storage of data, unlike standard input/output which is volatile. It then covers opening files in different modes, reading files line-by-line or as a whole, and modifying the file pointer position using seek(). Key points include opening files returns a file object, reading can be done line-by-line with for loops or using read()/readlines(), and seek() allows changing the file pointer location.
File management functions in C allow programs to work with files. They provide functions to open, read, write, and close files. Some key functions include fopen() to open a file, fread() and fwrite() to read from and write to files, and fclose() to close a file. Files can be opened in different modes like read, write, append depending on whether the file needs to be read from or written to. Command line arguments allow passing of inputs to a program from the command line when it is launched.
Unit-VI discusses files in C programming. A file is a collection of related records stored permanently on secondary storage devices like hard disks. There are several file operations in C - opening a file using fopen(), reading the file using fgetc(), and closing it using fclose(). Different text modes like w, r, a, w+, a+ are used for opening files for write, read, append, write and read, append and read operations respectively. Programs are provided to demonstrate opening, writing, reading and closing files in various modes.
This document discusses files and exception handling in Python. It begins by defining files and describing different types of files like data, text, and program files. It then covers topics like sequential and random file access, opening and closing files, reading and writing to files, and using file dialogs. The document also discusses retrieving data from the web using functions like urlopen. Finally, it defines exceptions and different types of errors like syntax, runtime, and logical errors. It explains how to handle exceptions in Python using try/except blocks and predefined or user-defined exceptions.
This document discusses file handling in Python. It begins by explaining that files allow permanent storage of data, unlike standard input/output which is volatile. It then covers opening files in different modes, reading and writing file contents using methods like read(), readline(), readlines(), seeking to different positions, and closing files. Examples are provided to illustrate reading temperature data from one file and writing converted values to another file. The document also discusses creating, deleting and renaming files and folders using OS module functions.
The document discusses file handling in Python. It begins by explaining the need for files, such as to store data permanently and access it faster. It then covers opening and closing files, different file modes, reading and writing text files, modifying files by replacing strings, and using file attributes and methods like seek, tell, readlines and writelines. The document provides examples to demonstrate basic text file operations in Python.
File handling in C allows storing program data in files that can be accessed later. There are two main file types: text files containing human-readable ASCII characters and binary files containing 0s and 1s in a non-human-readable format. Common file operations in C include creating, opening, writing, reading, moving within and closing files using functions like fopen(), fprintf(), fscanf(), fputc(), fgetc(), fclose(), and fseek(). A file pointer references an opened file and is required for read/write operations.
The document discusses file handling in Python. It begins by explaining the need for file handling such as storing data permanently and accessing it faster. It then defines what a file is and explains the different types of files - text files and binary files. It discusses the three main steps for file handling in Python - opening the file, processing the file by performing read/write operations, and closing the file. It also describes various file opening modes, methods for reading and writing text files, and modifying or appending content to text files.
File handling and Dictionaries in pythonnitamhaske
This document provides an introduction to file handling and dictionaries in Python. It discusses what files are and how they are used to store large amounts of data outside of RAM. Files are organized in a tree structure with paths to identify locations. There are two main types of files - text files which store character data and binary files which can store any type of data. The document outlines various functions for working with files, including open() to create a file object, close() to finish with the file, and attributes of the file object like name and mode. It also covers accessing a file, reading/writing data, and different modes for opening files.
This document provides information on file handling and dictionaries in Python. It discusses file paths, opening and closing files, reading from and writing to files. It also covers creating, accessing, adding, updating and deleting elements in dictionaries. Finally, it discusses directory methods like getcwd(), chdir(), listdir(), mkdir(), rmdir() and rename() for working with directories in Python.
The document discusses files and file operations in C/C++. It defines a file as a collection of bytes stored on a secondary storage device. There are different types of files like text files, data files, program files, and directory files. It describes opening, reading, writing, appending, and closing files using functions like fopen(), fread(), fwrite(), fclose(), etc. It also discusses random and sequential file access and modifying file contents using functions like fseek(), fread(), fwrite().
The document provides information about file pointers in C++. It states that a file pointer indicates the position in a file being accessed by a program. File pointers allow programs to move around within a file to read or write data at different locations. Some key functions that manipulate file pointers are seekg(), tellg(), seekp(), and tellp(). These functions respectively allow seeking to a particular location in a file for reading or writing, and returning the current file position. Precise control over file pointers is important when working with random access file I/O in C++.
Here are the answers to the quiz questions:
1. def read_file(file_name):
lines = []
with open(file_name, 'r') as f:
for line in f:
lines.append(line)
return lines
2. def input_list():
n = int(input("Enter number of elements : "))
list1 = []
for i in range(0, n):
ele = float(input())
list1.append(ele)
return list1
def output_list(list1):
for i in list1:
print(i)
3. def display_file(filename):
with open(filename
fread() and fwrite() are functions used to read and write structured data from files. fread() reads an entire structure block from a file into memory. fwrite() writes an entire structure block from memory to a file. These functions allow efficient reading and writing of complex data types like structures and arrays from binary files.
Introduction to Data Structure : PointerS P Sajjan
This document discusses pointers to structures and arrays in C programming. It explains how to declare a pointer to a structure, access members of a structure using pointer operators like -> and *, and define pointers to arrays of strings. It also covers pointers to pointers, opening and closing files, reading from and writing to files, and how to create and manage files in C.
Files allow programs to store and retrieve data permanently. There are three standard streams in C - standard input, output, and error. Files are accessed sequentially to process the data in order, or randomly to access records in any order. Functions like fopen(), fclose(), fprintf(), fscanf() allow opening, closing, reading from and writing to files. File streams have buffers associated with them for efficient reading and writing of data to disk in blocks.
The document discusses files and streams in C language. It explains that a file is a collection of bytes stored on a secondary storage device and has different types like data, text, program etc. It also describes streams as a series of bytes flowing between a program and file. The key functions for working with files and streams in C like fopen(), fclose(), fread(), fwrite() are explained along with their usage.
These slides contain the concept of Macros. Macros in C Language are very powerful and used mostly to reduce the time and size of a code. It also allows reusing the code
JIMS BCA Curriculum includes Macros in Unit V of Programming Using C Subject.
JIMS provides an updated Curriculum and includes the concepts in depth.
Admission to BCA is Open.
https://www.jimssouthdelhi.com/admission-procedure.html
BCA, Department of Information Technology teaches Python to Semester II students. The Curriculum of BCA JIMS is very well updated and as per the IT Industry. Admissions to BCA are open and students keen to do BCA have started applying.
To Apply for the best BCA College in Delhi NCR with the best Industry Interface you can visit www. jimssouthdelhi.com
Admission Open 2022, Apply Online
#BCAAdmissionOpen2022
#BestBCACollegeinDelhi
#JIMSVasantKunjII
#TopITPlacements
#ReasonableFees
#BCAUpdatedCurriculum
#TopBCAInstitute
#JIMSVasantKunjII
#BestBCACollegeinDelhi
#BCAADMISSIONOPEN2022
#BestBCACurriculum
#TopBCAPlacements
#BestIndustryInterface
Visit us at https://www.jimssouthdelhi.com/
BCA Course:https://www.jimssouthdelhi.com/course-bca.html
BCA Placements:https://www.jimssouthdelhi.com/bca-placement.html
BCA Admissions :https://www.jimssouthdelhi.com/admission-procedure.html
Follow us on:
Facebook: https://www.facebook.com/JIMSVASANTKUNJII/
Twitter: https://twitter.com/jimsljptweets
Instagram : : https://www.instagram.com/jims_vk2/?hl=en
YouTube: https://www.youtube.com/channel/UCZgioa2rpculDY7bHlljD6g
Blog: https://jimssouthdelhi.com/blog/
Linked In: https://www.linkedin.com/in/jims-vasant-kunj-ii-38785a85/
JIMS Vasant Kunj-II, BCA Department teaches Python in the Second Semester.
JIMS Vasant Kunj-II is one of the best BCA colleges in Delhi NCR.
BCA Admissions 2022 are Open. Interested Students can apply.
Visit us at https://www.jimssouthdelhi.com/
BCA Course:https://www.jimssouthdelhi.com/course-bca.html
BCA Placements:https://www.jimssouthdelhi.com/bca-placement.html
BCA Admissions :https://www.jimssouthdelhi.com/admission-procedure.html
Follow us on:
Facebook: https://www.facebook.com/JIMSVASANTKUNJII/
Twitter: https://twitter.com/jimsljptweets
Instagram : : https://www.instagram.com/jims_vk2/?hl=en
YouTube: https://www.youtube.com/channel/UCZgioa2rpculDY7bHlljD6g
Blog: https://jimssouthdelhi.com/blog/
Linked In: https://www.linkedin.com/in/jims-vasant-kunj-ii-38785a85/
BCA Department of Information Technology, JIMS Vasant Kunj-II teaches Java Language in IVth Semester. The Course Curriculum is very well updated. This PDF includes the details of Topic Polymorphism. Students should read it. JIMS Vasant Kunj-II provides the best BCA Course in Delhi NCR. The BCA Admission 2022 is open.
BCA, Department of Information Technology and Software Development teaches JAVA Language in the fourth semester. The curriculum of the BCA Course of JIMS is very well updated. In this PDF, the Constructor topic is explained. It is one of the very important Concepts and you need to understand it thoroughly.
BCA Department of Software Development and Information Technology shares the detail of Eclipse GUI Pallete and its configuration.
JIMS Vasant Kunj-II is the best BCA College in Delhi NCR. It provides the best BCA Course Curriculum and Top Placements.
The Faculties of the BCA department teach all languages in the latest tools, demand in the IT Companies and used by all Software Developers.
Eclise is one of the most demanding tools and we teach to BCA IV and V semester students. The curriculum includes Java, Advance Java, and web technologies.
Students kindly go through these details.
BCA Admissions are open, interested students can visit our website www.jimssouthdelhi.com
Machine Learning: Need of Machine Learning, Its Challenges and its ApplicationsArpana Awasthi
BCA Department of JIMS Vasant Kunj-II is one of the best BCA colleges in Delhi NCR. The curriculum is well updated and the subjects included all the latest technologies which are in demand.
JIMS BCA course teaches Python to II semester students and Artificial Intelligence Using Python to Sixth Semester students.
Here is a small article on the Future of Machine Learning, hope you will find it useful.
Machine Learning is a field of Computer science in which computer systems are able to learn from past experiences, examples, environments. With help of various Machine Learning Algorithms, Computers are provided with the ability to sense the data and produce some relevant results.
Machine learning Algorithms provide the technique of predicting the future outcomes or classifying information from the given input to the Machines so that the appropriate decisions can be taken.
JIMS is one of the best BCA colleges in Delhi NCR. The Curriculum they provide to the BCA students is well updated. So many activities are for BCA students like Guest Lectures from the IT Experts, Workshops, IT Activities, Annual IT Events, Emphasise on Research work and project Work. In this pdf, Dr. Arpana talks about various types of Programming Languages a BCA student should be aware of different Languages.
Role of machine learning in detection, prevention and treatment of cancerArpana Awasthi
Author: Dr. Arpana Chaturvedi (Jagannath International Management School, New Delhi, ac240871@gmail.com)
Artificial Intelligence, Machine Learning and Deep Learning now-a-days started playing its very effective and important role resulting great impact on various domains. These fields have been used in all areas as Data scientists realized that with the strength and power of rapidly growing data. The data shared by people of all ages in almost all social media handlers is of different types and in huge volume. This data consists of various kind of information related to almost all domains. Data analyst knows the power of this data and they introduced various techniques to get fruitful hidden insights from the data to benefit various organizations.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Infrastructure Challenges in Scaling RAG with Custom AI modelsZilliz
Building Retrieval-Augmented Generation (RAG) systems with open-source and custom AI models is a complex task. This talk explores the challenges in productionizing RAG systems, including retrieval performance, response synthesis, and evaluation. We’ll discuss how to leverage open-source models like text embeddings, language models, and custom fine-tuned models to enhance RAG performance. Additionally, we’ll cover how BentoML can help orchestrate and scale these AI components efficiently, ensuring seamless deployment and management of RAG systems in the cloud.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
1. Jagannath Institute of Management Sciences
Vasant Kunj-II, New Delhi - 110070
Subject Name: Programming In C
Department of Information Technology
Created By: Dr. Arpana Chaturvedi
@Dr. Arpana Chaturvedi
3. Topics to be Covered
▰ Concept of Files
▰ File opening in various modes and closing of a file
▰ Unformatted Input and Output Functions
▰ Formatted Input Output Functions
▰ Reading from a Binary file
▰ Writing onto a Binary file
5. Concept of Files in C
@Dr. Arpana Chaturvedi
▰ A file is an external collection of related data treated as a single unit.
▰ The primary purpose of a file is to keep a record of data.
▰ Since the contents of primary memory are lost when the computer is shut
down, we need files to store our data in a more permanent form.
▰ Hence we say, File is a collection of bytes that is stored on secondary storage
devices like disk
6. Why we need Files in C
@Dr. Arpana Chaturvedi
▰ When a program is terminated, the entire data is lost. Storing in a file will
preserve your data even if the program terminates.
▰ If you have to enter a large number of data, it will take a lot of time to enter
them all.
▰ However, if you have a file containing all the data, you can easily access the
contents of the file using a few commands in C.
▰ You can easily move your data from one computer to another without any
changes.
A file is an external
collection of related data treated as a unit.
7. Streams in C
@Dr. Arpana Chaturvedi
Data is input to and output from a stream. A stream can be
associated with a physical device, such as a terminal, or with
a file stored in auxiliary memory.
8. Standard Streams Of Files in C
@Dr. Arpana Chaturvedi
Standard stream names have
already been declared in the stdio.h header
file and cannot be declared again in our program.
There is no need to open and close the standard streams.
It is done automatically by the operating system.
10. Types of Files in C
@Dr. Arpana Chaturvedi
There are two kinds of files in a system. They are:
▰ Text files (ASCII)
▰ Binary files
Text Files
▰ Text files contain ASCII codes of digits, alphabetic and symbols.
▰ Text files are the normal .txt files. You can easily create text files using any
simple text editors such as Notepad.
▰ When you open those files, you'll see all the contents within the file as plain
text. You can easily edit or delete the contents.
▰ They take minimum effort to maintain, are easily readable, and provide the
least security and takes bigger storage space.
11. Types of Files in C
@Dr. Arpana Chaturvedi
Binary Files
▰ Binary file contains collection of bytes (0’s and 1’s). Binary files are compiled
version of text files.
▰ Binary files are mostly the .bin files in your computer.
▰ Instead of storing data in plain text, they store it in the binary form (0's and 1's).
▰ They can hold a higher amount of data, are not readable easily, and provides
better security than text files.
12. Difference between Types of Files in C
@Dr. Arpana Chaturvedi
Text File Binary File
Bits represent character. Bits represent a custom data.
Less prone to get corrupt as changes reflect as
soon as the file is opened and can easily be
undone.
Can easily get corrupted, even a single bit
change may corrupt the file.
Can store only plain text in a file.
Can store different types of data (image, audio,
text) in a single file.
Widely used file format and can be opened
using any simple text editor.
Developed especially for an application and
may not be understood by other applications.
Mostly .txt and .rtf are used as extensions to
text files.
Can have any application defined extension.
13. Binary and Text Files in C
Text files store data as a sequence of characters; binary files
store data as they are stored in primary memory.
15. Categories of Standard Input Output
Functions in C
@Dr. Arpana Chaturvedi
C has eight categories of standard file library functions.
16. BASIC FILE OPERATIONS IN C
PROGRAMMING
@Dr. Arpana Chaturvedi
Among all 8 Categories, There are 4 main basic operations that can be
performed on any files in C programming language.
▰ Opening/Creating a file
▰ Closing a file
▰ Reading a file
▰ Writing in a file
18. Opening/Creating a file:
@Dr. Arpana Chaturvedi
▰ In a C program, we declare a file pointer and use fopen().Opening a file is performed using
the fopen() function defined in the stdio.h header file.
▰ The C library function fopen() is used to open a filename pointed to, by filename using the
given mode to perform operations such as reading, writing etc.
▰ fopen() function creates a new file if the mentioned file name does not exist.
Syntax:
FILE *fopen (const char *filename, const char *mode)
OR
FILE *fp;
fp=fopen (“filename”, ”„mode”);
Where,
fp – file pointer to the data type “FILE”.
filename – the actual file name with full path of the file.
mode – refers to the operation that will be performed on
the file. Example: r, w, a, r+, w+ and a+.
Return Value
This function returns a FILE pointer. Otherwise, NULL is
returned and the global variable errno is set to indicate the
error.
20. MODE OF OPERATIONS PERFORMED ON
A FILE IN C LANGUAGE:
@Dr. Arpana Chaturvedi
There are many modes in opening a file. Based on the mode of file, it can be opened
for reading or writing or appending the texts.
▰ r – Opens a file in read mode and sets pointer to the first character in the file. It
returns null if file does not exist.
▰ w – Opens a file in write mode. It returns null if file could not be opened. If file
exists, data are overwritten.
▰ a – Opens a file in append mode. It returns null if file couldn’t be opened.
▰ r+ – Opens a file for read and write mode and sets pointer to the first character in
the file.
▰ w+ – opens a file for read and write mode and sets pointer to the first character
in the file.
▰ a+ – Opens a file for read and write mode and sets pointer to the first character
in the file. But, it can’t modify existing contents.
21. Different Opening Modes of Files in C
@Dr. Arpana Chaturvedi
Mode Meaning Description
fopen Returns if FILE
Exists Not Exists
r Reading
"r"
Opens a file for reading. The file must exist.
– NULL
w Writing
"w"
Creates an empty file for writing. If a file with
the same name already exists, its content is
erased and the file is considered as a new
empty file.
Over write on Existing Create New File
a Append
"a"
Appends to a file. Writing operations, append
data at the end of the file. The file is created
if it does not exist.
– Create New File
r+ Reading + Writing
"r+"
Opens a file to update both reading and
writing. The file must exist.
New data is written at
the beginning
overwriting existing
data
Create New File
w+ Reading + Writing
"w+"
Creates an empty file for both reading and
writing.
Over write on Existing Create New File
a+ Reading + Appending
"a+"
New data is appended
Create New File
27. Closing a file in C
@Dr. Arpana Chaturvedi
▰ The file (both text and binary) should be closed after reading/writing. Closing a
file is performed using the fclose() function.
Syntax:
▰ int fclose(FILE *fp);
▰ fclose() function closes the file that is being pointed by file pointer fp.
Eg.: In a C program, we close a file as below.
▰ fclose (fp);
28. Simple Program To Show Use Of Fopen
And Fclose Functions In C
@Dr. Arpana Chaturvedi
30. Read and Write Operations of Files in C
@Dr. Arpana Chaturvedi
31. Text and Binary Text File- Read/Write
in C
Formatted input/output, character input/output, and string
input/output functions can be used only with text files.
34. Unformatted Function to Read From The
File
@Dr. Arpana Chaturvedi
1. fgetc(): It is the simplest function to read a single character from a file.
Syntax:
int fgetc( FILE * fp );
▰ The fgetc() function reads a character from the input file referenced by fp. The
return value is the character read, or in case of any error, it returns EOF.
2. fgets(): The following function allows to read a string from a stream.
Syntax:
char *fgets( char *buf, int n, FILE *fp );
▰ The functions fgets() reads up to n-1 characters from the input stream referenced
by fp. It copies the read string into the buffer buf, appending a null character to
terminate the string.
▰ If this function encounters a newline character 'n' or the end of the file EOF before
they have read the maximum number of characters, then it returns only the
characters read up to that point including the new line character
35. fgetc()::
@Dr. Arpana Chaturvedi
▰ Description
▰ The C library function int fgetc(FILE *stream) gets the next character (an
unsigned char) from the specified stream and advances the position indicator
for the stream.
▰ Declaration
▰ Following is the declaration for fgetc() function.
▰ int fgetc(FILE *stream)
▰ Parameters
▰ • stream − This is the pointer to a FILE object that identifies the stream on
which the operation is to be performed.
▰ Return Value
▰ This function returns the character read as an unsigned char cast to an int or
EOF on end of file or error.
37. Unformatted Input Function to Read a File:
in C
@Dr. Arpana Chaturvedi
▰ gets() function
▰ The gets() function enables the user to enter some characters followed by the
enter key.
▰ All the characters entered by the user get stored in a character array.
▰ The null character is added to the array to make it a string.
▰ The gets() allows the user to enter the space-separated strings. It returns the
string entered by the user.
▰ Syntax:
▰ char[] gets(char[]);
38. Unformatted Input Function to Read a File:
in C
@Dr. Arpana Chaturvedi
1. fgets():
The C library function char *fgets(char *str, int n, FILE *stream) reads a line from the
specified stream and stores it into the string pointed to by str. It stops when either (n-1)
characters are read, the newline character is read, or the end-of-file is reached,
whichever comes first.
Syntax:
▰ char *fgets(char *str, int n, FILE *stream)
Parameters
▰ str − This is the pointer to an array of chars where the string read is stored.
▰ n − This is the maximum number of characters to be read (including the final null-
character). Usually, the length of the array passed as str is used.
▰ stream − This is the pointer to a FILE object that identifies
Return Value
On success, the function returns the same str
parameter. If the End-of-File is encountered
and no characters have been read, the
contents of str remain unchanged and a null
pointer is returned.
If an error occurs, a null pointer is returned.
43. Unformatted Functions to Write into a file
@Dr. Arpana Chaturvedi
1. fputc(): It is the simplest function to write individual characters to a stream.
Syntax:
▰ int fputc( int c, FILE *fp );
▰ The function fputc() writes the character value of the argument c to the output
stream referenced by fp. It returns the written character written on success
otherwise EOF if there is an error.
2. fputs(): To write a null-terminated string to a stream fputs() function is used.
Syntax:
▰ int fputs( const char *s, FILE *fp );
▰ The function fputs() writes the string s to the output stream referenced by fp.
▰ It returns a non-negative value on success,
Otherwise EOF is returned in case of any error.
44. C program which copies one file to another.
@Dr. Arpana Chaturvedi
45. C Program Which Copies One File To
Another.
@Dr. Arpana Chaturvedi
46. C Program Which Copies One File To
Another.
@Dr. Arpana Chaturvedi
47. C Program Which Copies One File To
Another.
@Dr. Arpana Chaturvedi
48. Writing And The Reading From The File
Characters Entered.
@Dr. Arpana Chaturvedi
49. Writing And The Reading From The File
Characters Entered.
@Dr. Arpana Chaturvedi