Side note, since you're using strlen() you ought to include string.h, and getch() doesn't seem to have a prototype declaration. Are you able to successfully compile a binary off your pasted code?
Type: Posts; User: shiryu3
Side note, since you're using strlen() you ought to include string.h, and getch() doesn't seem to have a prototype declaration. Are you able to successfully compile a binary off your pasted code?
You might consider using something other than integers so the interest can calculate propertly
I see another post with the same program:...
You're spot on with #1, that's a easy one.
As for #2...
I'm unclear about this, but does the user defined fraction between 0 & 1 need to multiply against the final average?
As for the...
Paste in the the full code with your updates and any compiling errors and the forum can better assist and attack items individually. Looks like your instructor has done all the fancy coding for you...
For a price...
Not the prettiest function since it has two return statements in the function, but I did this in a homework assignment in the past. Note tolowerStr() is a custom function to lowercase an entire...
Per CommonTater's point #3, note the space on the 2nd scanf() now
#include<stdio.h>
int main()
{
int age;
Have you tried typing all those up and compiling it, that'll spill the output too
Is this the same assignment from this thread? http://cboard.cprogramming.com/c-programming/126956-change-function.html
I think the value of pennies gets messed up through all the type conversions, and it may be a rounding issue. I got some results by adding 0.5 to the pennies and casting it as an integer.
strtod() is part of the standard library, otherwise you'll have to sscanf it yourself
I think you're looking for i++
Bloodshed Software - Dev-C++
Here's one at no cost, its a Windows front end for GCC/G++
No problem DJ, please take the time to compare this working code with your original post and look over all the broken syntax issues.
I admit I'm typing out solutions, but nothing that's going to give away the overall program. The requester here had a lot of broken C syntax so I felt it necessary that he be provided with something...
Here's a cheesy example of how I've been coding simple menus recently
#include <stdio.h>
int main()
{
int MenuOptions() ;
int choice ;
#include <stdio.h>
int main()
{
printf("Hello World!\n") ;
return 0;
}
Compiles to a 4719 byte binary in Linux, but I'm sure there's a good reason about the difference in...
Is this last snippet relevant to the 3-step program you're working on?
#include <stdio.h>
int main()
{
int number, i ;
printf("Enter a number: ") ;
scanf("%d", &number) ;
if ( number >= 0 && number <= 50 )
I think that 2nd posting of code confused us even more the specs on this.
Was this from some "IT course" or a latter half of a C programming class to get into link lists?
With letter declared in main, you may want to pass the address of letter as a argument of function step1().
Prototype:
void step1(char letter)
or declare char letter within the function and...
You might use strtok for this
#include <stdio.h>
#include <string.h>
#define LENGTH 64
int main()
Have you tried strtok() ?
I think return dog will do