Blogger Tips And Tricks|Latest Tips For Bloggers Free Backlinks

Monday 19 November 2012

Write a program to memory set memset() function in C language examples?

memset(),memory set,memset() function, memory set function,memset() in C,memory set in C,program to memory set function,program to memset() function,Write a program to memory set memset() function in C language,memset() in c language


memset() function

              To set all bytes in a block to a particular value,by use memset() function.

     Syntax

               void *memset(void destination,int set_value,size_t count);

   Program

                   #include<stdio.h>
                    char a[100] = "God gift programming";
                   main()
                   {
                         memset(a+2,'*',10);
                  
                         printf("After memset : %s\n",a);

                    }

              Output
                            After memset :  Go**********gramming
        In this case,from a[2] position to 10 positions are overlapped with *.i.e. memset().

                           

1 comments: