Actually I didnt know that. That's why I couldn't figure it out. Thanks for telling me this. I was probably taught it, but it either slipped my mind or I wasn't paying attention in class. The for...
Type: Posts; User: tommy69
Actually I didnt know that. That's why I couldn't figure it out. Thanks for telling me this. I was probably taught it, but it either slipped my mind or I wasn't paying attention in class. The for...
I forgot to put text instead of fileName....Now when I replaced it with text, then it seemed to work fine. I have a small problem with option 8 again. It's printing option1 like 7 times before...
When I tried to use this in my program, my code wouldn't work. I changed buf to text and fp to fname. For example, this part of code doesnt work:
system ("cls");
char text[80];
char...
Thanks for your help. I think I finally have this huge program completed. Huge in my standards. I really appreciate your time and patience and this also goes to everyone else who helped me.
Can anyone tell me why I am getting a number that is always 1 higher than the number of times an option was selected? For example, If I selected option4 (5) times, it would display the number 6.
...
I created a better way to encrypt and decrypt files. I don't know why I didnt think of this earlier. Let me know what you think:
void encrypt(FILE *fname)
{
FILE*encrypt;
char...
I figured this code out before you sent that Quazah. There are probably a lot of things wrong with the code or there are a lot of things that could be done to improve the code. For some reason, my...
I tried to try it, but when I go to open the file that I just created, it's empty. I'm trying to rename the file that I just opened and changed to lowercase.
I am still getting an empty file name. Here's the function again:
void lower(FILE *fname)
{
FILE *lower;
char text[81];
char fileName[13];
while(!feof(fname))...Take this code out then
I am opening a file first, then converting to lowercase.
After converting the file to lowercase, I need to write the lowercase text to a new file. So wouldn't I use the "w" to write?
The new file that I named is created with the correct name that I chose, but when I open the file, it's empty. Not sure why.
void lower(FILE *fname)
{
FILE *lower;
char text[81];...
Thanks Rouss. I almost completed option 3. I converted the text file to lowercase. However, I now need to write the lowercase text to a new file and allow the user to name the output file. I used...
Ok...I created a file using option1 and I named it hello.txt. I then went to Option2 and typed hello.txt and it opened the file and displayed it on screen. This is what it's supposed to do. ...
Well what I did was create the file using Option1. then I chose Option2 and tried to open the file created with Option1 and for some reason it's not opening. I'll check again.
Why can't I print the file that I name onto the screen? Is the printf statement wrong? It's supposed to read the contents of the file, up to the 81 characters specified in the text array. I am...
Function prototype is void character(FILE*);
When option 2 is selected:
void character(FILE *fname)
{
char text[81];
char fileName[13];
I kind of understand what you are saying. But I didn't think it would be a good idea to do this because this program is NOT using the same file each and every time. For example, option2, the one I...
I am trying to display the text of the file by using:
while (fgets(text,81,fname) !=NULL)
printf("%s", text);
Since I'm not returning anything from the function, can I just use...
For my function prototype, I have FILE*character(FILE*)
The switch statement for case 2:
text=character(text);
break;
Function:
...
quzah,
I am not asking him to do my complete homework. I only wrote down what I am supposed to do so there wont be any miscommunication when I ask him a question. So for your information, I have...
To make thing easier, I will write what I have to do for all 8 options. Just so you know and maybe you'll be able to understand a little better.
Option 1:
1.)Reuqest the name of the file....
I was working on my other class assignments. I just wanted to make one thing clear. My teacher said that I wont neccesarily be using the same file every time. I will be requesting A file, but not...
One other thing I forgot to mention. Each option except for option #8, I need to request the file. So for Option #2, after I request the file, it says display the input text. Since I am displaying...
ok...that'll work. I removed the FLUSH from this statement because once I created the file and named it and I was done writing to it, I had to hit enter twice to get back to the main menu. With...