#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <process.h>
void main(int argc, char *argv[])
{
char a[15];
char s[20];
char n;
int k;
int j=0;
int i;
int len;
FILE *fp;
if(argc!=3)
{
puts("Improper number of arguments.");
exit(0);
}
fp = fopen(argv[1],"r");
if(fp == NULL)
{
puts("File cannot be opened.");
exit(0);
}
k=*argv[2]-48;
n = fread(a,1,k,fp);
a[n]='\0';
len=strlen(a);
for(i=len-1;i>=0;i--)
{
s[j]=a[i];
printf("%c",s[j]);
j=j+1;
}
s[j+1]='\0';
getch();
}
#include<stdio.h>
#include<assert.h>
int main (void) {
FILE* pf;
int i, j, count;
char file[255];
char* buf;
while (true) {
printf ("File name: ");
scanf ("%s", file);
if (pf=fopen (file, "br+")) break;
printf ("Invalid file name\n");
}
while (true) {
printf ("Count of bytes to swap: ");
scanf ("%d", &count);
if (count<1) {
printf ("Count must be greater than 0\n");
continue;
}
buf = malloc (count * sizeof (char));
if (fread (buf, 1, count, pf)==count) break;
free (buf);
fseek (pf, 0, SEEK_SET);
printf ("The file doesn't contain enough bytes to swap\n");
}
assert (pf);
assert (buf);
i=-1, j=count;
while (--i<--j) swap (buf[i], buf[j]);
fseek (pf, 0, SEEK_SET);
fwrite (buf, 1, count, pf);
fclose (f);
free (buf);
return 0;
}
how programs are executed? Let we take C, how a c program is executing.... A first step we have to install a particular software for a execution so here we are installing turbo c then open the bin folder after the installation ,you will find on executable file named TC.exe it will look like a command prompt that only executing your c program files and giving another executable file for your program as output. to check fisrt create any simple program and first compile it and see the bin folder you will find one file named filename.obj and then run that program and now you will find another file filename.exe,that is an output file.
program to extract a given word from a file
Opening a file...for writing!
why does a program consists of more than one object file in c++
It is most likely an "import Java. ...." statement. Which imports packages to be used in the source file. Or a class declaration "public class myClass { ".
The file extension. It comes after the file nice, after the last dot in the name. For example someTextDocumet.txt has the extension TXT for plain text. The program that created it is most likely the default one for opening it.
You have to close the other program first, because when a program has a file open, the system locks the file.
It means a file or program is attached to another file or program, so that when the first file or program is run or moved then attaduded to it also , the first file or program takes the one attached to it along for the ride, like giving a biggy hence the term.
Unsupported file types are file extensions that Windows does not know what to do with. This means that there is no program installed on the computer associated with a particular file type. To open an unsupported file type you must first install the program that the file uses to work with it.
How do you add a program to a file folder?
Yes. If the file ends with .zip, it is a ZIP Archive file. There is a way to change the extension, however, using an extension changer found on the internet. The filename extension (characters to the right of the dot in the file name) identifies the type of file (unless this extension is renamed by a computer user) in most cases. The type of file will identify what can use or open the file, but not necessarily what created the file.
Things like ( .doc .exe .jpg .gif .xls ) are called file extensions. They tell the operating system which program to use in order to read/understand the data contained in the file. For instance if you were to try to open a file named "My_term_paper.doc" the computer would see the .doc and know to open your chosen word processing program.
Windows 95 supported file names up to 255 characters in length.
Files are named in the method: filename.extension When the file is a program, the extension is 'exe' so if a file called 'hello' was a program, it would be called: hello.exe
That is the file extension. Each file has this extension to tell the system what to do with the file. For example, a program has .exe at the end. This means that it is an executable file, so the system will launch it as a standard executable. A document has .doc or .docx. The system checks file association when you run it, and tells whatever program is set to handle documents to open that file. If you have MS Word, then it will open the file. If you use Open Office, then that program will open it. If you change the extension, then a different program will try to open the file. For example, changing a .jpg to a .txt will open notepad. However, the file is not actually plain text, so you will see many pages of gibberish, since notepad doesn't really know what to do with the image file.
First you have to have a File Server or a Host that will allow you to upload your file. Then you can use a type of program that is known as a "File Transfer Protocol" software. This program will log-in to the Host's File Server and locate the appropriate folder and move the program for you. You can search the internet and find free FTP software to do this. BUT you have to have a website to upload the file to. You can register for a website NAME. You can do this yourself or some places will do this for you and then rent you the file server space for your files.
Assuming that the file you are looking at is a columnar file you can use the 'cut' command, as in 'cut -c1-2 filename'