I need to develop an application in VC++ that will take .WAV files as an input and identify if there is a Gun shot in that wave file. WAVE file with gunshot must be having certain paramaters like frequency, bit rate etc which I don't know right now. But is there a way in VC++ to develop a program that can recognize gunshots by comparing that .WAV file with certain parameters?
#include "stdafx.h" #include <iostream> #include <string> using namespace std;
int x; string favword;
[Code] ....
I want this program to be able to recognize if a user types in any word ex. (apple, tree, house etc..) and print "system error" if a word is recognized not to be a number. The bold section of code is my failed attempt to try this. Basically I need to know what to make
(x = ?(every word)) in order to finish my console program.
I'm trying to write a function which can recognize whether a word is a palindrome. if it's the case , it must return 1 on screen, otherwise 0. This is the code which return 0 even in case of a palindrome...
Code: int IsPalindrom(char String[]){ int i,l; int counter=0; for(i=0;;i++){ //counts the number of array elements
/*Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result.(For division, if the denominator is zero, output and appropriate message.) Some sample outputs follow:
I need to write a c program that can receive signals and recognize a certain pattern (SIGUSR1, SIGUSR2, SIGUSR1, SIGUSR2). once the pattern is caught the program terminates itself.
I am able to send the signals to the program from a different process, but I am unsure on how to get the signal handler to recognize the pattern. here is what i have so far:
My use case is this: I have a C# Console application. I would like to run it via the Windows Task Scheduler, and would like it to attempt to run until it succeeds. My problem is that I can't achieve this. How does the Windows Task Scheduler recognize that a program has failed? I tried returning 1 or 32 instead of 0 but that didn't work. One possibility is to have the rerun logic in the C# console application but it feels like there must be a better way.
I'm very new to MFC & VisualC++. I'm using MSVS2010 Pro. I am trying to write/debug a simple form that saves and restores the content of some edit controls. It seems to work as expected, except the file saves only to the Project Folder, regardless of where I browse and select to save the file.
Code: void CMFC_FileDialogDlg::OnBnClickedbtnsave() { this->UpdateData(); CFile f; //Kinda Correct, Works but still saves in Project Folder BOOL b_OpenFileDialog = FALSE;//this doesn't act as bool in CFileDialog?
[Code] ....
My only experience is a little simple VB programming in Excel, so any specific examples??? Also, rules seem to change from version to version? I have to "update" a number of undocumented programs.
I created a new project in Qt Creator, the files included are the .Pro file, and the .Cpp file.
Qt does not recognize the headers I try to reference in the .Cpp file. I am pretty sure it's because of what I don't have in my .Pro file. What do I add to it?
.Cpp
Code: #include <QApplication> ->No such File or Directory #include <QPushButton> ->No such File or Directory #include <QHBoxLayout> ->No such File or Directory int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget *window = new QWidget;
I'm trying to build libglib using MSVC. libglib doesn't use dllexport - so to create usable DLLs it needs to generate a .DEF file. It does this by using a .symbols file. Here's a cut-down example:-
Code: /* This file lists all exported symbols. It is used to generate the glib.def file used to control exports on Windows.*/
/* glib.symbols */ g_mkdir_with_parents
#ifdef G_OS_WIN32 g_file_get_contents_utf8 #endif
The following commands would produce the following files called glib.def
Problem:- Although I can run the macro as a pre-build step (and it does produce conditional entries in the generated .DEF file) it DOESN'T produce the word EXPORTS at the top of the file. So the linker then fails to recognise it as a valid .DEF file.
How can I add that word EXPORTS to the top of the generated file? I tried just adding EXPORTS to the top of the symbols file but that didn't work. I also tried this variation on the macro:-
I am currently writing a program that grabs information from a .dat file. When I go to debut I get this error.
Code: #include <iostream> #include <string> #include <fstream> using namespace std; // function step 1 - declare the prototypes void sort(int n); // catches an integer number from the call void swap(string *p1, string *p2); //catches the location of data in ram
I am developing a CFormView MFC app. When I go to click something on the menu, it takes awhile before the event happens. The project is build optimized in release mode. I have 3 additional threads and I thought they might be blocking the internal MFC framework stuff, but I use the Sleep() call in each thread to yield to the MFC main app.
I have written code that saves a matrix to a utf-8 file. This code works just fine when invoked from a win32 console app, but if I attempt to use the exact same code by invoking it within a SDI Doc/View Serialize(CArchive& ar), if(ar.IsStoring), it fails, but in a somewhat unusual manner. Namely, the file shows up in the designated directory, but it is an empty file (0 bytes), and the 'Unable to open file' message is seen in Debug config. Note that both the win32 console app and the SDI app are both using a Unicode character set, however, only the SDI app uses the method inside a Serialize(CArchive& ar) method, whereas the win32 console app evokes the save method directly from within _tmain. Why this seemingly illogical disparity occurs.
Here's the template code I have used in innumerable applications to save matrices to a disk file.
Code: namespace TNT { // saves a TNT double matrix, discriminating between real and complex matrices by virtue of the respective file markers, 'MATCALC94R' and 'MATCALC94C'. template <class T> void SaveRealBMatrix(const Matrix<T> &M, string sfilename) { _RPT0(0, "SaveRealBMatrix: "); _RPT1(0, "sfilename =: |%s|
[Code] ....
Here's the code from the SDI document Serialize(CArchive& ar) that fails as described above. Note that m_M is a class member TNT::Matrix<double> m_M that has been verified to exist in the Serialize method.
The program then asks the user for a search string, which may contain white space. The program should search the file for every occurrence of the search string. When the string is found, the line that contains it should be displayed in the following format
nnnnn:Line Contents
That is the line number of the line, 5 columns wide, right justified, followed by a colon, followed by the contents of the line.
And this is what I've got so far:
Code: #include<iostream> #include<fstream> #include<string> #include<iomanip> using namespace std; int main(int argc, char *argv[]) { ifstream inFile; string fileName,
[code]....
But this doesn't work. It prints everything in the file, not just the lines where the string is found.
I have a jpg file. I have extracted the width and the length of the image. I have done that with some codes and markers. Now I need the image data starts as from that place i would like read the data and print the pixel value. I would like to display the pixels later.
I have a project that has a few .asm files (assembly language code), I have the compiler/assembler set to create a list file for the assembly code and would like the debugger to use the .lst file for the source instead of the .asm files because in the .asm files the macros are not expanded like they are in the .lst files which makes debugging difficult sometimes.