Here's my new code
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
struct elem {
char word [ 50 ];
Type: Posts; User: hinman
Here's my new code
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
struct elem {
char word [ 50 ];
I understand your logic (somehow), but tell me what these 2 lines of codes are supposed to do ?
fgets(s,50,stdin);
delete(&startptr,s);
Errors:
Hi,
I would like to delete an element from a singled linked list, I have the written the function, but I have some troubles calling it.
The program accepts any words and stores them in the...
I am having hard time testing this function, can you please show me how to use the sprintf and make the average ?
here's my code
#include <stdio.h>
#include <stdlib.h>
#include...
any coding example, or tutorial would be welcome. ;)
all right thanks for your help :) (the keyword was to uppercase)
I made a for loop such as follow:
for (i=1; i < sizeof buffer; i++)
{
buffer[i] = toupper(buffer[i]);
}
I have an input file that contains lines
word1 word2 word3 45 78 90
word3 word4 word5 45 80 100
My program read its lines and displays them in another file using:
FILE * fp, * outptr, * outptr2;
char buffer [ 81 ];
int i;
outptr = fopen ("file1.dat","w");
outptr2 = fopen ("file2.dat","w");
if ( ( fp = fopen ( FILENAME, "r" ) ) == NULL ) {
...
No it's not what i am trying to do, there are 2 files, the first one is file.dat the second is file1.dat
File.dat has a list of 10 lines.
When I do this:
while ( fgets( buffer, sizeof...
Where did you see any problem with the identation of these 4 lines of code ??
while ( fgets( buffer, sizeof buffer, fp ) != NULL ) fputs( buffer, stdout ); {
outptr = fopen...
thanks but it's not what I all need.
copying a file to a terminal, i've already been able to do it.
but how about writing a new file that writes what the program has read ?
while (...
thanks for your reply
well, I changed the code a bit
while ( ! feof ( fp ) ) {
outptr = fopen ("file1.dat","w");
fputs ( buffer, stdout );
fgets ( buffer, 81, fp );
I have been able to read what are the contents of a file and display them on the screen, it worked well
Then i tried to write a new file (file1.dat) that contains the odd lines of the first file....
tx macgyver for the answer, well 1st, i did not like quzah's answer because he's talking about failing a homework since the 1st post, what the heck ? it s not a homework, it is something that I want...
check the discouraging quzah's answer
edited