The program i am writing takes in 6 strings a0,b0,c0,x0,y0 and z0. It then converts them to doubles a,b,c,x,y,z using the atof function. if the user types "f" then it goes to the divide function that...
Type: Posts; User: JezW
The program i am writing takes in 6 strings a0,b0,c0,x0,y0 and z0. It then converts them to doubles a,b,c,x,y,z using the atof function. if the user types "f" then it goes to the divide function that...
thanks guys i know this is really basic stuff but i do appreciate it and its very helpful :)
Jez
thanks for the replys guys.
"/ *I won't even speculate why you're converting the value you calculate to an int */"
I thought "int" was how you defined a function!?
sorry mate i don't understand. do u mean this:
#include <stdio.h>
#include <stdlib.h>
int divide(float c);
int main(float fraction)
i am trying to return the result "c" back to the main function. can anyone see why this isn't printing the correct answer the second time?
thanks, jez
#include <stdio.h>
#include...
thanks i think i'm doing alright now
thanks for the quick replies ;)
Brafil i will work on what you said but am having trouble getting the switch and case "a" part to work, it says there is a syntax problem.
Adak, are you saying...
The program that I am writing takes 6 inputs from the user which are all numbers. When all the numbers have been inputted the program asks whether the user is happy with the values. If they enter...
and how might one go about this?
Jez
is there no way to just send the value of a variable from one function to another?
thanks,
Jez
yes that is what i'm trying to do!
please can you show me how?
I am trying to ditch my global variables but i can't work out how to send a variable between functions...
eg.
int main(float x)
{
calculate();
thanks for the reply matsp. couple of Qs:
1.Can you elaborate on the difference between scanf and gets? What's the difference between entering aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa when...
Just out of interest have you written many programs before jcafaro?
I have limited experience but don't understand a single line of you code. Can you explain a couple of lines for me?
...
could i have something like this? can't get it work properly...
int functiona(void)
{
system("cls"); /*This clears the screen and displays the data*/
...
Thanks for the replies.
Ben10, the isdigit function sounds like what i'm looking for, i'll give it a go ;)
vart please can you elaborate on fgets, and parsing with strtol or strtod?
Sorry...
I want to be able to check if the user has entered "two" or even gibberish as one of the number inputs.
What i have so far checks whether each input = 0. If it does it confirms that with the user...
#include<stdio.h>
struct employees
{
int employee_num;
int age;
char genger;
float hourly_rate;
}Acc_receivable[4];