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
...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 statements
tStdout = fdopen(iNewStdout...
...way to achive our aim.
Use the following code this will solve the problem.
#include <stdio.h>
int main()
{
int iNewStdout;
FILE *fpStdout;
char text[100];
/* creation of duplicate file descriptor for stdout */
iNewStdout = dup(1);
fpStdout =...
...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 (*)[3])...
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)...
...This clearStdin() just reads that \n character and clears the stdin.
Dynamic array declaration like int arrayName[var1] is not possible.
For this use dynamic memory manipulation using the malloc and free.
use like the following
int *p;
p = (int *) malloc(var1 * sizeof(int));
--Maniraja S
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...
...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 pointerVariable by one...
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.