Are your asking the compilation procedures ?.
Create the programa using vi editor and compile the c programs by giving the command gcc CProgramName
and g++ CppProgramName.
---Maniraja S
Just the macro calls (BAUD or PARITY) are replaced by the defined constants (9600 or 8N1) in the program by the preprocessor.
After this preprocessor substitution the compiler will do its work. So 9600, and 8N1 will be treated based on the code.
--Maniraja
Hi,
Call the function format_agent_code as
format_agent_code(rec.agent_code); //just remove the &, which makes lot of difference in the argument type.
But the error message is something different, it may be there in some other part of the program.
---Maniraja S
By combining MaheshRathi & Jyrixx ideas I have given a sample program. It may fulfill your requirement.
#include <iostream>
#include <cstring>
using namespace std;
typedef union
{
int iData;
double dData;
char sData[100];
}DATA;
class stackUnion
{
private :
struct
{
unsigned char...
Hi Maschwa,
I have posted the code for Unix OS. If your using the Turboc C/C++ IDE for DOS, then do the following changes.
1. Declare one more pointer variable of the type FILE,
ie FILE *tStdout;
2. Instead of the statement
stdout = fdopen(iNewStdout, "w"); put the following...
The freopen() will close the orginal stream(in our case it is stdout; passed as an argument to this function), but we are having some other way to achive our aim.
Use the following code this will solve the problem.
#include <stdio.h>
int main()
{
int iNewStdout;
FILE *fpStdout...
If you know the number of columns then you can allocate the 2d array like the following also.
#include <stdio.h>
#include <malloc.h>
int main()
{
int (*p)[3];
int i, j, r;
printf("Enter number of rows : ");
scanf("%d", &r);
p = (int...
Hi jstreich,
The given if statement
if(index < 0 && index >= arrayLength)
will never become true (the arrayLength will not be <= 0).
Check it.
Maniraja S
An example.
#include <iostream>
using namespace std;
class ArrayObject
{
int *array;
int arrayLength;
public :
ArrayObject(int i)
{
arrayLength = i;
array = new int[10];
}
int & operator [] (int index)...
Hi,
Use the following function.
void clearStdin()
{
char cs[10];
gets(cs);
}
define this function within your program and call this function like
clearStdin();
before the the fgets and after the scanf().
These reason for this is that the scanf will store the entered integer into the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.