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: zub44
  • Order by date
  1. zub44

    Math Problem

    It sounds to me like temp_state[i].lhrev = 0.0, but if you are sure that the values of the arguments are all correct before the operation, then try: temp_print[i].percent_dh = (temp_state[i].lhrev/([COLOR=red](float)[/color...
  2. zub44

    Waiting X number of minutes

    My question is similiar to the one recently posted about waiting for x milliseconds. I have an idea of how to make a program wait for X minutes, but I would like to hear others opinions or suggestions about how to do this. The following function works, but it continously has the processor...
  3. zub44

    how to use NAN

    Hi For the purposes of debugging a program, I would like to be able to ask whether a (double) variable has the value NAN (not a number). My question how do I check if x == NAN ? For example: #include <stdio.h> #include <math.h> int main() { double x; x = sqrt(-1.0); printf("x =...
  4. zub44

    B = &amp;A[0][0]; ??? if A is dynamically allocated

    I would like to have a 1D pointer point to a M by N 2D dynamically allocated array. If the 2D is a constant array, everything works fine: main() { int i, j; double *b, A[3][2]; for (i = 0; i < 3; i++) for (j = 0; j < 2; j++) A[i][j] = 1.0; b = &A[0][0]...
  5. zub44

    mem allocation inside function

    That did it. (*A)[i] instead of *A[i]. I copied and pasted the code so the []'s must not of shown up. Thanks again.
  6. zub44

    mem allocation inside function

    Im not sure why the following code will not work. I get a segmentation fault when *A[i] is assigned to 1.0 inside F. #include <stdio.h> #include <stdlib.h> #define N 5 void F (double **A); main() { int i; double *A; F(&A); for (i = 0; i < N; i++) printf(&quot;%5f &quot;, A[i]); }...
  7. zub44

    mem allocation inside function

    I would like to pass a pointer to a function and have it allocate mememory for this pointer inside the function. #include <stdio.h> #include <stdlib.h> void f (double **A); main() { double *A; f(A); /*or f(&A) ?? */ } void f (double **A) { A = malloc(10*sizeof(double*) )...

Part and Inventory Search

Back
Top