NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

int arr[5]={1,2,3,4};
char str[10]=
char=1
float,int=4
total no of elements in array=sizeof(a)/sizeof(int)
scanf reads until it encounters space newline tab
gets() function allow to read a string containing spaces from user.
puts() function allow to print a string containing spaces.
diff bw gets() and fgets()
gets() will read all charectars entered irrespective of size while fgets() function allows to reads a specified number of characters.
Syntax:
fgets(string_name, sizeof(string_name), stdin);
int atoi(str)-ascii to int value


Pointer is a variable that holds the address of another variable.
datatype *variable_name; or
datatype* variable_name;
%p is a format specifier which is used for displaying the address in hexadecimal.
malloc()
Stands for memory allocation.
Allocates block of memory of specified type and return a pointer of type void which can be casted into any type of pointer. It leaves the memory uninitialized.
calloc()
Stands for contiguous allocation.
Allocates contiguous memory and return a pointer to the memory. It initializes all allocated bytes to zero.
Note: Dynamically allocated memory created with either malloc() or calloc() doesn't get freed
on their own.
free()
Free previously allocated memory
realloc()
Alters the size of previously allocated memory
STRUCTURES AND UNIONS
A union is a special data type available in C that allows to store different data types in the
same memory location.

You can define a union with many members, but only one member can contain a value at
any given time i.e. on shared memory, any fresh data replaces any existing data.
Union provide an efficient way of using the same memory location for multiple-purpose
Both structure and unions are used to group a number of different variables together. Syntactically both structure and unions are exactly same.
The main difference between them is in memory storage.
In structures, each member has its own memory location but all members of union use the same memory location which is equal to the greatest member’s size.
topics left
lab assignment 6,8,9
est 3 papers
1)revise arrays strings pointers and control structures file handling
2)arrays programs






















     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.