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...
Ok, but few changes.
char **b;
b = (char **) malloc(256 * sizeof(char *));
put b[0] = (char *) malloc(noOfCharacters * sizeof(char));
or as u said
b[i] = &extract[i];
If you want to allocate two dimensional arrays then do like the following.
int main()
{
int (*p)[3];
int i, j...
1. declare a unsigned short int pointer variable.
2, assign the starting address of the memory ( which you want to read) to that pointer variable.
Now you can put *pointerVariable and can see the value. If you want you can store it in an array. To see the next element, increment the...
Hi, problem is there in ur strcmp function. You should pass the address of the character array to that function not just the characters itself.
If your case replace the if statement which contains the strcmp() in the getString() like the following.
if(key == in[p])
it will do everything.
One...
Hi,
Do like the following, it will solv your problem.
#include <iostream.h>
int main()
{
char name[100];
while(1) // To terminate the loop press Ctrl C
{
cin.get(name, 20, '\r');
cout << name << endl;
cin.ignore(1000...
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.