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 SkipVought 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: *

  • Users: sirbu
  • Order by date
  1. sirbu

    Passing to a function just a member of a struct

    Guys, think at solving a linear system of equations. You can use a function like void Solver(double A[], double B[], double *X) where you pass two vectors A and B and the result is returned in X vector. I want to pass to the function Solver my vector of structures (but not all, just the...
  2. sirbu

    Passing to a function just a member of a struct

    My question is allmost what jfhuang answered. GetVal(n->attribute1); works fine for a scalar but how to do for a vector, because something like GetValue(n(i)->attribute1) won't work (sorry for the round brackets!). So i think what Zyrenyhian answerd is closer to my question. Thanks both
  3. sirbu

    Passing to a function just a member of a struct

    Can it be passed to a function just a member of a struct so that the function changes that member? Let's say a have a struct struct node { double attribute1, attribute2; } *n; I define an array of the above tipe, n = (struct node *) calloc (666,(sizeof (struct node))); The question...
  4. sirbu

    C Integrated Developing Environment

    A good IDE is LccWin32. You cand find int at: http://www.cs.virginia.edu/~lcc-win32/
  5. sirbu

    extern variables in WinMain and how to use GetVolumeInformation.

    Hy everyone, first a question: I have a C file where the WinMain function resides, and where on the WM_COMMAND case I handle menu options. As an example on IDM_FILE_NEW I launch a dialog box from where I get some input which I convert to numeric variables. The dialog function I've wrote in a...
  6. sirbu

    C (Inverse Powers)

    For bigger numbers you may get an over or underflow so you have to use some bignum library. Hope it will help. #include <stdio.h> #include <math.h> int main (void) { int i; double InvSquare,InvCube,InvQuatric; for (i=1; i<100; i++) { InvSquare = 1./(i*i); InvCube = 1./(i*i*i)...
  7. sirbu

    Moving around in files...

    I think you can try a combination between fgets to read a line from your source file, alter the line as your wish and after that use puts to write the line in your destination file. Hope it will help
  8. sirbu

    Which Compiler???

    Try, http://www.cs.virginia.edu/~lcc-win32/ it's a very good free compiler with a lot of features and complete documentation.
  9. sirbu

    win32 api call in C

    I have a dialog with an edit box written in C (à la Petzold). What I read from the edit box with GetDlgItemText function I convert to a double with an expression like: kk = strtod(szText,&rpt); Then I want to pass the variable kk to a MessageBox, so I use wsprintf(szBuffer,TEXT(&quot;Your...
  10. sirbu

    Best book for C

    There is no such thing like “the best book”. Each book gives you something and you must filter the information on your own taste and capabilities. You must read all you can put hand on. A (free) point to start is the C tutorials on the web.
  11. sirbu

    Working with files in C

    Let’s say that I have a variable char filename[12] = &quot;xxxxxxxx.xxx&quot;; and a function who opens a file. void OpenFile( char *fname) { FILE *f; f = fopen(fname,&quot;w&quot;); if( f == NULL ) { printf( &quot;File could not be opened\n&quot; )...
  12. sirbu

    How to define a boolean data type in C?

    Please can anyone help with suggestions about how to define a Boolean data type in C? For my logical tests now I use one integer and if the condition is TRUE the integer takes value 1 and if FALSE the integer gets 0. But that's rather complicated. If anyone has a simpler way please let me...
  13. sirbu

    Help on functions that returns an array

    Hy,<br>please can anyone tell me how to write a function that returns an array. I mean when writing a function like<br><br>return_type funct_name ( arg_type arg1, ....)<br>{}<br><br>the return_type should be an array (of double maybe).
  14. sirbu

    Passing structure components as arguments to a routine

    If i have a structure like :<br><br>struct node {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;double x,y;<br> &nbsp;&nbsp;&nbsp;&nbsp;} *n;<br><br>i would like to code a routine, called from main program, who reads the two components of the structure.<br><br>void ReadStruct( ? ? ? ? ? ...
  15. sirbu

    How to convert a float value into a char value

    I've written a code in C that performs several computations at various time steps. I want to save the results for each time step in a file. So if anybody can help me, how to change a float type number (the time value ex. 10.25) into a string so i can strcpy it into the file name.<br>ThankYou

Part and Inventory Search

Back
Top