Pages

Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Sunday 14 September 2014

`gets' function is dangerous how to solve this error and why gets function is dangerous?

  `gets' function is dangerous how to solve this error and why gets function is dangerous?







Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will
read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use.
It has been used to break computer security. Use fgets() instead.

so we can use fgets():
In the C Programming Language, the fgets function reads characters from the stream pointed to by stream.
The fgets function will stop reading when n-1 characters are read, the first new-line character is encountered in s, or at the end-of-file, whichever comes first. Then the fgets function will append a null character to the string.

Syntax

The syntax for the C Language fgets function is:

char *fgets(char *s, int n, FILE *stream);
  
s is the array where the characters that are read will be stored.

n is the size of s.

stream is the stream to read.

The fgets function returns s. The fgets function will return a null pointer if an error occurs while trying to read the stream or the end of the stream is encountered before any characters are stored.

In the C Language, the required header for the fgets function is:

#include 
 

#include 
char * fgets(char *restrict s, int n, FILE *restrict stream);
Frightening, no? That’s because fgets() is a file function, which reads text from a file, as in “file get string.” That’s how programmers talk after an all-nighter.
Because the operating system considers standard input like a file, you can use fgets() to read text from the keyboard.
Here’s a simplified version of the fgets() function as it applies to reading text input:
fgets(string,size,stdin);
In this example, string is the name of a char array, a string variable; size is the amount of text to input plus one, which should be the same size as the char array; and stdin is the name of the standard input device, as defined in the stdio.h header file.
THE FGETS() FUNCTION READS A STRING
#include 
int main()
{
  char name[10];
  printf("Who are you? ");
  fgets(name,10,stdin);
  printf("Glad to meet you, %s.\n",name);
  return(0);
}

what is sudo tar -xzf? why it is used?



what is sudo tar -xzf? why it is used?

tar is basically The GNU version of the tar archiving utility for more information on tar got to the terminal and type
man tar
You will find out what exactly xzf is used for. Basically they flags (options) when you run a tar command.
[-]x --extract --get: -z --gzip: -f --file F:
The order of this command does matter though.
Basically your command sudo tar -xzf utorrent-server-3.0-ubuntu-10.10-27079.tar.gz will extract the tar.gz archive that you specify as (utorrent-server-3.0-ubuntu-10.10-27079.tar.gz) and will do so as root privileges.

Linux Error: strrev function is error ( undefined reference to `strrev' collect2: ld returned 1 exit status)




undefined reference to `strrev' collect2: ld returned 1 exit status

Functions like strupr, strlwr, strrev, which are available in ANSI C (Turbo C/C++) are not available in standard C (gcc).

That's because it quite probably *is not* included in the library.
I do not think the C standard library has ever included a function
called strrev(). Some implementation somewhere might provide one, but
it is not part of standard C.


I get linking error invoking this fucntion, as if it it not
 > inluded in the library.  Why?

 There are no function named strrev in the standard C
library. Furthermore, any implementation that defines a function with
a lovercase name starting with 'str' is non-conforming, as those names
are reserved.

...
 > /tmp/ccKGR6e9.o: In function `main':
 > /tmp/ccKGR6e9.o(.text+0x27): undefined reference to `strrev'
 > collect2: ld returned 1 exit status
 However, looking at my collection of non-standard header files, I
have a hunch that strrev() might be a MSVC-ism, so you might actually
have a chance to find some information about this extension in an
appropiate newsgroup like comp.os.ms-windows.programmer or similar.


how to check linux kernel is 32 bit or 64 bit




how to check linux kernel is 32 bit or 64 bit

uname -m. It seems like the uname -m actually gives
x86_64 ==> 64-bit kernel
i686   ==> 32-bit kernel

[ SOLVE] E-FAIL ERROR IN VIRTUAL BOX or VM ORACLE MACHINE



[ SOLVE] E-FAIL ERROR IN VIRTUAL BOX or VM ORACLE MACHINE


Runtime error opening 'C:\Users\COMPUTER_NAME\.VirtualBox\Machines\VM_NAME\VM_NAME.xml' for reading: -102 (File not found.).
D:\tinderbox\win-3.2\src\VBox\Main\MachineImpl.cpp[665] (Machine::registeredInit).
Result Code:
E_FAIL (0x80004005)
Component:
VirtualBox
Interface:
IVirtualBox {3f36e024-7fed-4f20-a02c-9158a82b44e6}



SOL:
I went into the folder "C:\Users\COMPUTER_NAME\.VirtualBox\Machines\VM_NAME\" and saw two xml files but for some reason they both had suffixes.
1. VM_NAME.xml-prev
2. VM_NAME.xml-tmp
So it simply just couldn't find "VM_NAME.xml" because it technically didn't exist.
I made a copy of the "VM_NAME.xml-prev" file and renamed the copy to "VM_NAME.xml"
Restarted VirtualBox and it worked just fine.
S0L2:
UPDATE VM AUTOMATICALLY  SOLVE THE ISSUE.

Wednesday 11 June 2014

Latest Collection Of Best Blogger Templatees Download 2014

 Latest Collection Of Best Blogger Templatees Download

                  Dynamic Mag     downlaod and view demo

                                        click here

                  blogger mag       downlaod and view demo

 

                                        click here

                  gamer mag downlaod and view demo

 

                                        click here

                 famemag      downlaod and view demo

                                

 

                                         click here

                 ang amor downlaod and view demo

 

                                          click here

                 elite mina    downlaod and view demo

 

                                     click here

                  funkyzine  downlaod and view demo

 

                  

                                        click here

 

                   Simplo  downlaod and view demo

 

                                   click here

LATEST BEST COLLECTION OF ECOMMERCE BLOGGER TEMPLATES FREE DOWNLOAD

CLICK HERE  DOWNLOAD LIVE DEMO THE TEMPLATES:

1.Boutique shopping Responsive e-shopping Blogger Template Free Download 

                                

                              CLICK HERE

 

2.Johny Blackstore Responsive e-shopping Blogger Template Free Download

                           

                                CLICK HERE

 

3. johny mega store blogger ecommerce template download

                   

 

 

                                 CLICK HERE

 

4.johny jass store blogger ecommerce film template download

 

                                 CLICK HERE

 

5.shoppaholic cart ecommerce blogger template download 

 

                                     CLICK HERE

 

6.Johny Crott Ecommerce ekart Blogger Template Free Download 

 

                                CLICK HERE

 

7.BlogrShop Ecommerce ekart blogger template download

 

                             CLICK HERE