Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. smaniraja

    threads with Linux?

    Take look at http://users.actcom.co.il/~choo/lupg/tutorials/multi-thread/multi-thread.html This may be very much useful for you. ---Maniraja S
  2. smaniraja

    Programing games

    Its up to you to decide, but in DOS you will not get much sophisticated library as Windows. Try OpenGL.
  3. smaniraja

    tc terminates after displaying output

    Hi hasanasghar00, see the corrected code below. --Maniraja S #include <stdio.H> #include <iostream.h> #include <conio.h> #include <stdlib.h> #include <alloc.h> #include <string.h> int main(void) { FILE *fptr; char fname[10],temp[10]; int n=0,i=0,j=0,k=0, *bof; char ch,(*addr)[4]; char...
  4. smaniraja

    programming in unix

    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
  5. smaniraja

    What types of identifier do #define pragmas create?

    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
  6. smaniraja

    Simple code - but not working now !

    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
  7. smaniraja

    how to write a scheduler program for dos using turbo-c?

    I think you can not use TSR programs to control/Access the activity of a Windows application. You have to choose the Windows schedule programming.
  8. smaniraja

    Stack that can handle both strings and floats in the same class??

    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...
  9. smaniraja

    stdout

    Can you post the Error ?.
  10. smaniraja

    stdout

    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, &quot;w&quot;); put the following...
  11. smaniraja

    stdout

    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...
  12. smaniraja

    Dynamic memory allocation for 2D arrays

    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(&quot;Enter number of rows : &quot;); scanf(&quot;%d&quot;, &r); p = (int...
  13. smaniraja

    overload [] for class to work like an array

    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
  14. smaniraja

    overload [] for class to work like an array

    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)...
  15. smaniraja

    fgets(), arrays, and declaring an array midway through a file

    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...
  16. smaniraja

    using malloc to create array of pointers

    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...
  17. smaniraja

    Data manip. in memory

    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...
  18. smaniraja

    written this code but having trouble

    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...
  19. smaniraja

    To LiquidBinary or any interested soul

    #include <stdio.h> int main() { char name[][6] = {&quot;One&quot;, &quot;Two&quot;, &quot;Three&quot;}; char *p1, *p2, *p3; p1 = name[0]; p2 = name[1]; p3 = name[2]; printf(&quot;\nThe characters are %c %c %c&quot;, *p1, *p2, *p3); return 0; }
  20. smaniraja

    Truncate the char and clean the buffer.

    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...

Part and Inventory Search

Back
Top