display the contents of all the files

This is a discussion on display the contents of all the files within the C Programming forums, part of the General Programming Boards category; Hi...Can anyone plz give me a program to display the contents of all files inC...

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    11

    display the contents of all the files

    Hi...Can anyone plz give me a program to display the contents of all files inC

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    You want a program to open and print the contents of every file in the world?

    Code:
    #include <stdio.h>
    
    int main(void)
    {
    	printf("Ask a real question.\n");
    	return 0;
    }
    http://www.catb.org/~esr/faqs/smart-questions.html

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    11

    plz..very urgent

    Plz help me to fin out the program to concaternate the contents of all the files

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    11

    Concatenating files

    I have three files..and i need to concatenate these...not the whole files in the world

  5. #5
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Don't spam the forum for your sense of urgency.

    <<threads merged>>
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,337
    How about contributing something along the lines of "I've got this far", that is, post the code for something you've managed to do already (say copy a file).

    We're not here to pander to your 1-line demands for code, you need to offer up something to show you've tried first.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    11

    Pattern skipping

    Hi..this is the program i wrote to find the pattern matching..how can i alter the same to find pattern skipping?

    Code:
    #include<STDIO.H>
    
    main(){
    
    	int lengthofTot;
    	char total[1000];
    	char Patstring[100];
    	int result[100];
    	int lengthofPat;
    	int i,j,k,l=0,boom=0;
    	clrscr();
    
    
    	printf("Enter the Sequence:");
    	scanf("%s",&total);
    
    	printf("Enter the Pattern:");
    	scanf("%s",Patstring);
    
    	lengthofTot = strlen(total);
    	lengthofPat = strlen(Patstring);
    
    	for(i=0;i<lengthofTot;i++){
    		k = i;
    		for(j=0;j<lengthofPat;j++){
    			if(Patstring[j] == total[k]){
    				k=k+1;
    				l=l+1;
    			}
    		}
    		if(l==lengthofPat){
    		  result[boom] = i;
    		  boom=boom+1;
    		}
    		l=0;
    	}
    
    	printf("Occurance:\n");
    	for(i=0;i<boom;i++){
    		printf("%d - %d;\n",result[i]+1,result[i]+lengthofPat);
    	}
    	getch();
    }

  8. #8
    Registered User
    Join Date
    Sep 2007
    Location
    somewhere out there
    Posts
    7
    hmm.. all files with an extension name of .C?
    is that what you mean?

  9. #9
    Registered User
    Join Date
    Oct 2007
    Posts
    11
    i posted two problems that i have..the first one was what you say concatenating the files with an extension of .c...the code that i have sent now is a different problem ie to find the pattern skipping of a string

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Read and display data from files
    By Karpaty in forum C Programming
    Replies: 5
    Last Post: 11-30-2007, 01:11 PM
  2. Help with loading files into rich text box
    By blueparukia in forum C# Programming
    Replies: 3
    Last Post: 10-19-2007, 12:59 AM
  3. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  4. Replies: 1
    Last Post: 07-24-2002, 06:33 AM
  5. reinserting htm files into chm help files
    By verb in forum Windows Programming
    Replies: 0
    Last Post: 02-15-2002, 08:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21