Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Recent content by Rusty

  1. R

    Can't find my mistake

    The calc_vle function takes an element of temperature array and calculates a value of x. The unique value x goes through an iteration until it's condition equation is satisfied. Then x is written to it's own arrray. Everything about the function is executing correctly except writing the iterated...
  2. R

    Unused variable warnings- type pointer

    I get it now! Warnings gone of course but more importantly I have a clearer understanding of pointer concept. Still think they are they're own special kind of weird but I'm absolutely delighted with this learning and outcome. Older but wiser today. And that's what makes older worth it. Thank...
  3. R

    Unused variable warnings- type pointer

    It's starting to gel. What I lack in quick I make up for in obstinate 😉 I will of course follow your code advice and take the rest of it to heart. May not be available tomorrow but the resolution is at the front of my mind. Thanks for persistence. Your comment about legacy code reminds me of a...
  4. R

    Unused variable warnings- type pointer

    I appreciate your patience and assistance. My purpose of passing variables by reference is to modify and return more than one variable in a function. It seems get_user_input works properly in that regard. Or no? The pass by reference value of *peth_mol1 to the function "initial conditions"...
  5. R

    Unused variable warnings- type pointer

    Maybe this is where I don't understand. *peth_mol1 passed to initial_conditions as formal argument in definition. But passed to function call as &eth_mol1 as actual argument. If I said that correctly. Similar with pboil_pt1 in bp_by_t function
  6. R

    Unused variable warnings- type pointer

    Really struggling here this morning. Tried several times to insert the screenshot of warnings with earlier post. Now I have two. 🤔 I'm using CodeBlocks with GNU GCC compiler. Yes did use code thingy </> as per code I posted recently. Select C language and tried to paste in window at line 1...
  7. R

    Unused variable warnings- type pointer

    I am using pointers, in part, to modify variables passed to functions by reference. The compiler generates warnings of unused variables that I believe I am in fact using, though indirectly. I thought I understood how to use and code pointers, at least a little. But evidently not? The program...
  8. R

    Modulo with double and int types

    Thank your for considering my dilemma. I came up with nearly identical solution just minutes before I saw your reply. I'm committed to C for this endeavor but have been poking around Python. I'm a bit old now and use this learning to keep mentally agile... neuro-plasticity the aging...
  9. R

    Modulo with double and int types

    Still searching... Thought there was some promise in fmod() function but no success. Suppose I could do 'if else': is value == .1, .3, .5, etc but just seems so inelegant. Maybe treat it as string? Reason I'm posting is going down these avenues by trial and error take soooo much time, as a...
  10. R

    Modulo with double and int types

    The larger program models a distillation process. Other parameters to the model are functions of temperature and pressure. The list will end up as a lookup table that I want to have an increment that includes a whole number for temperature. I'm not faulting the compiler. I was looking for...
  11. R

    Modulo with double and int types

    Trying to generate a list of temperatures that increment by 0.2 degrees in even numbers. The first temperature in the list is the result of a separate function not shown. Always a float but could be even or odd. The objective is to: Trim the first generated temperature to one digit after the...
  12. R

    Loop problems

    Fixed. Basically took it apart. Put back together incrementally. Works and on to other stuff. Thanks :)
  13. R

    Loop problems

  14. R

    Loop problems

    It seem the first for loop is not incrementing. Supposed to populate the x1 array with 0 to 1 in 0.01 increments. Then seems like the second for loop is not terminating. Thanks for help/advice. #include <stdio.h> #include <stdlib.h> #include <math.h> #define NUM_MIXTURE_PERCENTAGES 101...
  15. R

    Simple code - best practices?

    Thank you simple. Advice for a function per equation helps. Likewise with functions for conversions. "P.S. Don't be afraid of using multiple source and header files for organizing functions." (Can't get that quote thingy to work). Above code is intended to be part of larger program...
Back
Top Bottom