Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to print the value of variable which is define in header file.?

how to print the value of variable which is define in header file.?

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestestingbeta-testingtutorialquestion
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mybm1
    wrote on last edited by
    #1

    #ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c

    L S 3 Replies Last reply
    0
    • M mybm1

      #ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      First you need to create a function pf that takes an integer value and prints it somewhere. Given this and your other questions, I think you would benefit from studying a decent book on C/C++, or search the internet for some tutorials. You cannot learn C programming by just asking questions on this forum.

      M 1 Reply Last reply
      0
      • L Lost User

        First you need to create a function pf that takes an integer value and prints it somewhere. Given this and your other questions, I think you would benefit from studying a decent book on C/C++, or search the internet for some tutorials. You cannot learn C programming by just asking questions on this forum.

        M Offline
        M Offline
        mybm1
        wrote on last edited by
        #3

        pf i wrote is not function its printf()

        L 1 Reply Last reply
        0
        • M mybm1

          pf i wrote is not function its printf()

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Well it really does not help us if you do not show the exact code that you have a problem with. If you want to learn how to use printf correctly then I suggest studying the documentation[^].

          M 1 Reply Last reply
          0
          • L Lost User

            Well it really does not help us if you do not show the exact code that you have a problem with. If you want to learn how to use printf correctly then I suggest studying the documentation[^].

            M Offline
            M Offline
            mybm1
            wrote on last edited by
            #5

            Please have a watch upon my code ..

            L 1 Reply Last reply
            0
            • M mybm1

              Please have a watch upon my code ..

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Sorry, I don't understand what you mean.

              1 Reply Last reply
              0
              • M mybm1

                #ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                maibam debina wrote:

                but error is generating undeclared details.

                That is because you are using a structure or class reference for something that is a simple integer value. It should be just:

                coefficients=NUM_OF_COEFFICIENTS;
                printf("Num of ceptral coefficients=%d",coefficients);

                M 1 Reply Last reply
                0
                • L Lost User

                  maibam debina wrote:

                  but error is generating undeclared details.

                  That is because you are using a structure or class reference for something that is a simple integer value. It should be just:

                  coefficients=NUM_OF_COEFFICIENTS;
                  printf("Num of ceptral coefficients=%d",coefficients);

                  M Offline
                  M Offline
                  mybm1
                  wrote on last edited by
                  #8

                  Thank you Richard ..hav a nice day

                  1 Reply Last reply
                  0
                  • M mybm1

                    #ifndef _MFCC_DEFINES_H_ #define _MFCC_DEFINES_H_ #define PI 3.1415926536 #define framesize1 20 #define frameshift1 10 #define DFT_POINT 1024 #define NUM_OF_FILTER 22 #define NUM_OF_COEFFICIENTS 13 #define NUM_OF_GAUSSIANS 1024 /*1024=POW(2,NODES)*/ #define NUM_OF_MIX 512 #define TOTAL_MODEL 13312 /*13312=NUM_OF_GAUSSIANS*NUM_OF_COEFFICIENTS*/ #define EPS 0.01 #define THRESHOLD 0.01 #define NODES 10 /* Total no of nodes******/ #define NUM_OF_SPEAKERS 30 #define FILE_NAME_LENGTH 30 #define SPEAKERIDSTART 9000 #define FIVESPEAKERS 5 #define VALID "V" // Valid #define INVALID "I" // Invalid #define CHANNELFLAG 0 // If CHANNELFLAG is 1 Cepstral Mean Substraction will be done. #define SIZE_FULLPATH 150 #define maxtrain 20 // number of train model #define maxtest 1000 // number of testing wav file #define now_test "./" #define curenttraingtest "./curentlist1.txt" #define testpath "./" #define result12 "./result04.txt"; #define SPEECH_NONSPEECH "./speech_nonspeech.txt" // Consists boolean array of size equal to total no. of frames, for a speeched frame value is 1 and for nonspeeched frame value is 0. #define NO_SPEECH_FRAMES "./no_speech_frames.txt" #define STARTING_POINT "./starting_point.txt" #define END_POINT "./end_point.txt" #define ID_EXTENSION "_AM03MENR" // Common extension to all the speaker ID's. AM03MENR - session(A) OnlineMobile(M03) (M)ultienvironment (EN)glish (R)eading #define FILE_EXTENSION ".wav" // File name extension for wave file #define AVR_ENR "./avr_enr.txt" #define PATH_TEXT "./" // Path to the directory which contains all the text files #define PATH_TRAIN "/home/ast9/text_independent/recorded_files/train/"// Path to the directory which contains all the recorded training files #define PATH_TEST "/home/ast9/text_independent/recorded_files/test/" // Path to the directory which contains all the recorded testing files #define PATH_TEXT_MULTI "/home/ast9/textfiles/" //Path to the directory which contains all the multilevel text files. #define PATH_COUNT "/home/ast9/textfiles/count.txt" //Path to the directory which contains count.txt file. #define spechmfcc "./" char * mfcc_computation(char *id, int, char *fullpath_input, int,int,int,int,int); #endif here is the header.h code. From this if i try to print the NUM_OF_COEFFICIENTS in main program using c

                    S Offline
                    S Offline
                    Stefan_Lang
                    wrote on last edited by
                    #9

                    I can only agree with Richard. I've had a look at some of your questions and found that you're lacking the most fundamental understanding on how to properly write and test a program in C. Please do yourself and everyone else a favor and use a proper C book or tutorial. One of the first links I found on that topic is this: http://www.cprogramming.com/tutorial/c-tutorial.html[^] . Read that tutorial, take your time to understand what it teaches you. Make sure to actually try out the program snippets. Learn how to set up your working environment: compiler, linker, debugger. Once you've done that you'll save a lot of time because you won't need to ask about such basic problems. Learning C will take a considerable amount of time. But not learning it properly will cost you even more time in the long run, and others as well!

                    GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups