What exactly is it your trying to do?
I just wrote a program that has the user input a month, either in English or Spanish, and then translates it and gives the number of days in that month.
I...
Type: Posts; User: mmcg
What exactly is it your trying to do?
I just wrote a program that has the user input a month, either in English or Spanish, and then translates it and gives the number of days in that month.
I...
To use an element in a structure, you use the following:
structname.elementname
So it's the name of the structure, then a fullstop, then the name of the element in the structure. Here's an...
Is it just me or are the if and elseif comparisons in the for loop exactly the same?
Use the tolower() function on the string before you compare it, that way whatever case the user enters it in, it'll still compare properly.
And can structures be passed to a function? I don't...
Here you go:
It's a better function than scanf() and gets(), and it'll keep your code as C and not a mixture of C/C++! ;)
You could always use fgets()?
And you're main function should end with:
return(0);
I'm nearly finished C For Dummies and it's been a very good read. It explains things very well, there's a bit of humour and the pace is very easygoing. Very good book for beginners with no experience...
This better?
#include <stdio.h>
#include <stdlib.h>
int main()
{
float usd;
Just knocked this up. I'm pretty new to programming, been learning C for the past few weeks.
#include <stdio.h>
#include <stdlib.h>
int main()
{
char usdi[32];