When I define the variables as ints, the %d is rounded to a whole number in the printf call, why is it doing that?
Type: Posts; User: fuso
When I define the variables as ints, the %d is rounded to a whole number in the printf call, why is it doing that?
Ok, another one
Trying to print the 'average word length' which I'm trying to define as total characters/total words
Do all of these variables need to be defined as doubles from the offset?
...
aha!
Thanks!
That's what I thought I'd done...
else if(text_input = ' ')
word_count++;
Ok, another quick question, more to do with the logical side of things.
Basically I've added a few lines in order to make a word count - using the number of spaces + 1, however my program seems to...
I'm using the Borland C++
Yeah it does prompt me for a file name, in fact the whole thing works pretty well
Hmm, ok it doesn't notepad anymore, and in fact just freezes the command prompt
Ok so now it's physically opening the file I type in (i.e. it loads notepad), which is intereting - a good thing you say?
How come it's ignoring the rest of my code after that?
Here is the appended version (I hope!)
It now freezes after returning a file name...
#include <stdio.h>
#define ALPHABET_TOTAL 26
Are these ammendments a necessity in order for the program to work? Or are they sophisticated tricks?
I don't think I'm going about the right way of reading characters from the file either; do I...
Ok, I think I'm using fgets properly...
This program is doing my head in. I'm struggling. It doesn't work. Any freindly help would be greatly appreciated!
FILE *fp; ...
I think for my purposes, gets() should be fine - the filename will not be longer than 99 characters.
Do I define 'filename' as a string?
Quick question regarding file opening;
My compiler tells me I have an undefined symbol 'filename' in function main; how (and where) do I define it?
printf("Type a file name, followed...
Cheers guys - I think I do need to try and comprehend the program as a whole more
Quick question - is it possible to includemore than one 'else if' branch?
so in this context:
while(...
Hi there :)
Ok, basically I'm pretty new to C and have created a mashed-together program using different elements from different existing programs:
#include <stdio.h>
#define...