#include <stdio.h>
#include <conio.h>
void main() {
FILE *fp;
char a,data[100];//Just taking 100 bytes not more that that.
int i = 0,count = 0;
fp = fopen("C:\\mydo c.txt","r");
// Here my file is stored at C:\ as mydoc.txt
clrscr();
if(fp == NULL) {
printf("ERROR READING FILE\n");
getch();
exit(0);...
User Profile
Collapse
-
Simple code for de-comment a .C file
//This code will output this code file with out the comment lines
#include <stdio.h>
#include <conio.h>
void main() {
FILE *fp;
char data,chardata;
fp = fopen("\\OUTPUT .C","r");
clrscr();
//This is the start of this code
/* This part opens the file and
* reads the contents.
*/
if(fp == NULL) {
printf("CAN... -
near (type modifier)
Forces pointers to be near; generates function code for a near call and a
near return.
Syntax:
<type> near <pointer definition> ;
<type> near <function definition>
The first version of near declares a pointer to be one word with a range of
64K.
This type modifier is usually used when compiling in the medium,... -
inline (keyword): Declares/defines C++ inline functions
Syntax:
<datatype> <function>(<par ameters>) { <statements>; }
inline <datatype> <class>::<funct ion> (<parameters>) { <statements>; }
In C++, you can both declare and define a member function within its class.
Such functions are called inline.
The first syntax example...Leave a comment:
-
EXTERN (keyword): Indicates that the actual storage and initial value of a variable, or body
of a function, is defined elsewhere, usually in a separate source code
module.
Syntax:
extern <data definition> ;
extern <function prototype> ;
The keyword extern is optional for a function prototype.
Example:
extern int _fmode;
extern void Factorial(int...Leave a comment:
-
VOLATILE: The reason for having this type qualifier is mainly to do with the problems that are encountered in real-time or embedded systems programming using C. Imagine that you are writing code that controls a hardware device by placing appropriate values in hardware registers at known absolute addresses.
Let's imagine that the device has two registers, each 16 bits long, at ascending memory addresses; the first one is the control and...Leave a comment:
-
VOID: void (type)-Empty data type
When used as a function return type, void means that the function does not
return a value.
void hello(char *name)
{
printf("Hello, %s.",name);
}
When found in a function heading, void means the function does not take any
parameters.
int init(void)
{
return 1;
}
...Leave a comment:
-
Enable your program to load and run other files (child processes)
Use these execl... functions when you know how many separate arguments
you'll have:
Declaration:
int execl (char *path, char *arg0, ..., NULL);
int execle (char *path, char *arg0, ..., NULL, char **env);
int execlp (char *path, char *arg0, ...);
int execlpe(char *path, char *arg0, ..., NULL, char **env);...Leave a comment:
-
Each and every time we write a code, that is verified by the compiler generated syntax & semantics tree. Which part does not match with the tree, compiler throws an error.... This is known as compilation time error / syntactic error.
The runtime errors are the errors, which are generated by the environment, or the logical errors as divided by zero error. The runtime errors, which are generated by the operating system, are like Lvalue...Leave a comment:
-
nearestniladri2003 replied to reading words from a file in C that was stored in an array(PROGRAM )i requirein CYou can use this following code and where I have written "USE ARRAY", use your array there....
::code removed per Posting Guidelines::
HAPPY CODING in "C" - Representing the whole COMPUTERLeave a comment:
-
Did you try this?
printf("/r Hello");
I feel this is the simplest way to do that..... I have tried in Turbo C++ (Ver 3.0).
Happy Coding in "C" - Representing the whole COMPUTERLeave a comment:
No activity results to display
Show More
Leave a comment: