Click here to Skip to main content
15,905,963 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Can some one please tell me how to insert items into a friggin CListCtrl Pin
Richard MacCutchan24-Jul-14 20:41
mveRichard MacCutchan24-Jul-14 20:41 
GeneralRe: Can some one please tell me how to insert items into a friggin CListCtrl Pin
Member 1095872128-Jul-14 23:55
Member 1095872128-Jul-14 23:55 
GeneralRe: Can some one please tell me how to insert items into a friggin CListCtrl Pin
Richard MacCutchan29-Jul-14 5:16
mveRichard MacCutchan29-Jul-14 5:16 
Questionhow to generate text file for a program output? Pin
mybm124-Jul-14 0:41
mybm124-Jul-14 0:41 
AnswerRe: how to generate text file for a program output? Pin
Richard MacCutchan24-Jul-14 1:07
mveRichard MacCutchan24-Jul-14 1:07 
GeneralRe: how to generate .txt file as output dynamic for this program? Pin
mybm124-Jul-14 1:47
mybm124-Jul-14 1:47 
GeneralRe: how to generate .txt file as output dynamic for this program? Pin
Richard MacCutchan24-Jul-14 2:05
mveRichard MacCutchan24-Jul-14 2:05 
GeneralRe: how to generate text file for a program output? Pin
mybm124-Jul-14 2:05
mybm124-Jul-14 2:05 
<blockquote class="quote"><div class="op">Quote:</div>
#include <sys/types.h>  // for scandir
#include <sys/dir.h>    // for alphasort and structure dirent 
#include <sys/param.h>  // for MAXPATHLEN and getwd
#include <stdio.h>
 #include "Utility.c"
#include "Utility.h"
//#include <stdlib.h>
#include <math.h>
#define FALSE 0
#define TRUE !FALSE
 
extern  int alphasort();// extern extend the visiblity of the function alphasort 
                        //alphasort used as the comparison function for the scandir() line no 24 function to sort the directory
 
char pathname[MAXPATHLEN];
 
main()   { int count,i;
				struct direct **files;//pointer to a pointer ,which point to the object call files here
				int file_select();
                                //printf("\n enter the file ")
				if (getwd(pathname) == NULL ) // return absolute file name of current directory
						{ printf("Error getting path\n");
								exit(0);
						}
				printf("Current Working Directory = %s\n",pathname);
				count =
				  scandir(pathname, &files, file_select, alphasort);//scandir returns the current directory (.) and the 									directory above this (..) as well as all files so we need to check
 
				/* If no files found, make a non-selectable menu item */
				if 		(count <= 0)
						{		 printf("No files in this directory\n");
								exit(0);
						}
				printf("Number of files = %d\n",count);
				for (i=1;i<count+1;++i){

						 printf("\n%s\n  ",files[i-1]->d_name);

						int SizeOfData,j;
	
	float *data;
//	float *text;
	char *wavFileName=".wav";
         FILE *fout;

	
	/*if (argc < 2) {
		printf("\nUsage : SID_IITG waveFileName \n");
		return -1;
	}*/
 
	
	//wavRead(argv[1],&SizeOfData) ;
	
	data=wavRead(files[i-1]->d_name,&SizeOfData) ;  //func  call  to read wave file
//	text =wavRead(files[i-1]->d_name,&SizeOfData) ;
	printf("\nReading Done\n");
    
        fout = fopen ("dataSamples","w");	// output file
//	fout = fopen ("datasamples.txt","w");
	j=0;
	while (j < SizeOfData) {

		//printf("%f\n",data[j]);	

		fprintf(fout, "%f\n",data[j]);	
  //              fprintf(fout, "%f\n",text[j]);
		j++;
	}



				}
				printf("\n"); /* flush buffer */
		}



int file_select(struct direct   *entry)
 { char *ptr;
   char *rindex(char *s, char c);
		 if ((strcmp(entry->d_name, ".") == 0) ||
						(strcmp(entry->d_name, "..") == 0))
						 return (FALSE);
  						 // checking of its extension 
						ptr = rindex(entry->d_name, '.');
				 if ((ptr != NULL) &&
						 ((strcmp(ptr, ".wav") == 0)  ))/*||
						  (strcmp(ptr, ".txt") == 0) ||
						  (strcmp(ptr, ".c") == 0) )) */
								 return (TRUE);
									else
									return (FALSE);
		}
</blockquote>


// along with the output if what shall i do for getting text file of the output also.?
GeneralRe: how to generate text file for a program output? Pin
Richard MacCutchan24-Jul-14 2:11
mveRichard MacCutchan24-Jul-14 2:11 
GeneralRe: how to generate text file for a program output? Pin
mybm124-Jul-14 18:47
mybm124-Jul-14 18:47 
GeneralRe: how to generate text file for a program output? Pin
Richard MacCutchan24-Jul-14 20:35
mveRichard MacCutchan24-Jul-14 20:35 
AnswerRe: how to generate text file for a program output? Pin
CPallini24-Jul-14 2:46
mveCPallini24-Jul-14 2:46 
GeneralRe: how to generate text file for a program output? Pin
mybm124-Jul-14 18:49
mybm124-Jul-14 18:49 
GeneralRe: how to generate text file for a program output? Pin
mybm127-Jul-14 20:49
mybm127-Jul-14 20:49 
GeneralRe: how to generate text file for a program output? Pin
CPallini27-Jul-14 21:25
mveCPallini27-Jul-14 21:25 
Questionhow to display specific file in a folder using c program in ubuntu? Pin
mybm123-Jul-14 20:43
mybm123-Jul-14 20:43 
AnswerRe: how to display specific file in a folder using c program in ubuntu? Pin
mybm123-Jul-14 20:44
mybm123-Jul-14 20:44 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
Richard MacCutchan23-Jul-14 22:11
mveRichard MacCutchan23-Jul-14 22:11 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
mybm123-Jul-14 23:10
mybm123-Jul-14 23:10 
QuestionRe: how to display specific file in a folder using c program in ubuntu? Pin
Richard MacCutchan24-Jul-14 0:27
mveRichard MacCutchan24-Jul-14 0:27 
AnswerRe: how to display specific file in a folder using c program in ubuntu? Pin
mybm124-Jul-14 0:39
mybm124-Jul-14 0:39 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
Richard MacCutchan24-Jul-14 1:04
mveRichard MacCutchan24-Jul-14 1:04 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
mybm124-Jul-14 1:24
mybm124-Jul-14 1:24 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
Richard MacCutchan24-Jul-14 1:38
mveRichard MacCutchan24-Jul-14 1:38 
GeneralRe: how to display specific file in a folder using c program in ubuntu? Pin
mybm124-Jul-14 1:41
mybm124-Jul-14 1:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.