C++ :: How To Load WAV Files In Vector Or Array

Feb 28, 2013

How to load .wav files. Say there are several .wav files in a folder called "sounds" in "My Documents", what would be the steps on loading them in a vector or array. I'm thinking I should use a vector type of array to not worry for a fixed size.

View 3 Replies


ADVERTISEMENT

C++ :: Load PNG Files And Extract RGB Pixels?

Apr 18, 2014

How to load png files and extract their rgb pixels? Library recomendations?

View 2 Replies View Related

C++ :: How To Load Contents Of Text File Into Array

May 12, 2013

So I am working on a FUSE filesystem and I currently have the need to load the contents of a text file into an array.

My array initialization looks like: char array[max_entries][PATH_MAX] = {NULL}

The reason I want to pass it by reference is that I want my function to return two values essentially. One a specific char* and the other an array like I initialized. My function proto type looks like:

char* load_meta(char* list[max_entries][PATH_MAX], char* path, int mode);

How I'm trying to call the function:

someChar = load_meta(&array, path_name, 1);

Within the function I try to edit the array by deferenceing it once, like this:

strcpy(*list[i], file_entry); // This seg faults

View 8 Replies View Related

C++ :: Using Vector Push Back Function To Output Contents Of Vector (similar To Array)

Feb 9, 2015

How to output vector contents using the push_back function. My program reads in values just fine, but it does not output anything and I've been stuck on why.

here is my code:

#include <iostream>
#include <array>
#include <vector>
using namespace std;
int duplicate( vector < int > &vector1, const int value, const int counter)

[Code].....

View 3 Replies View Related

C++ :: How To Load / Run File

Sep 26, 2013

Let's say I create a small program or just want to open any kind of file on my computer, but I want to run a program that forces the user to enter a password or something (I already know this part). How does one create the code that would open the file?

View 5 Replies View Related

C :: Save And Load Game

Nov 26, 2013

I am trying to put my Save and Load function in my game, this is what i have:

Code:
/* Save game */
void GuardarJuego() {
FILE *fsave;
char turno;
fsave=fopen("SAVE.txt", "w");
fputs(*****, fsave);

[Code] .....

My game code is this: [C] GameCode - Pastebin.com

View 8 Replies View Related

C++ :: How Does SDL Load Bitmap Images

Apr 8, 2013

I don't mean how do I load a bmp, I mean how does SDL manage to do this?

View 2 Replies View Related

C++ :: Load PNG Image To Use As Texture?

May 24, 2014

I'm trying to load a PNG image to use as texture, but when I compile the sdl window closes. I'm sure the error is in the function of generating the png texture, because when i donĀ“t use this function, the sdl window does not close. So debugging using cout i found that the cout above glTexImage2D function, shows in console, but the cout in below of glTexImage2D does not work. Does not reading this image?

hear is the function

#include "Texture.h"
#include <iostream>
Texture::Texture() {}

[Code].....

View 9 Replies View Related

C/C++ :: How To Load Maps From A Txt File

Dec 29, 2014

i have made this first level in this ascii game, and i realized that if i want to continue, i must rewrite the switch statement and write thousands of lines of code. how can i load a map from a txt file?

#include <iostream>
#include <windows.h>
using namespace std;

[Code].....

View 3 Replies View Related

C++ :: Cannot Load OpenCV Library

Mar 22, 2014

I am trying to run a console program but for any reason it displays an error on the cv.h line.

View 5 Replies View Related

Visual C++ :: How To Load Satellite DLL For A DLL

Jan 18, 2013

I have a Visual C++ workspace that has 2 projects (1 exe & 1 DLL). I used Serge Wautier's tutorial [URL] .... to create (multi-language) resource DLLs (satellite DLLs) branching off the exe.

Now I have a collection of strings in the DLL that are shared in other projects. I created a satellite DLL for that DLL but can't figure out how to load it on-demand just like the exe's satellite DLL.

He used:
HINSTANCE hDll = LoadLibrary(szFilename);
AfxSetResourceHandle(hDll);
void CLanguageSupport::UnloadResourceDll() {
if (m_hDll!=NULL) {
SetResourceHandle(AfxGetApp()->m_hInstance); // Restores the EXE as the resource container.
FreeLibrary(m_hDll);
m_hDll= NULL;
}
}

etc etc ... for the unloading/loading satellite DLLs for the exe. But how to do the same for the DLL?

View 5 Replies View Related

C++ :: Creating Multiple Files Using Array?

May 29, 2014

I am trying to create n number of files (n being an integer), by passing the name through a character array (and obviously changing its value at each iteration). But the problem is that the program compiles and executes but not a single file is created.

Here is my code snippet.

void file_phipsi(int m)
{
int a=0,n=0;
char *str1;

[Code].....

View 4 Replies View Related

C++ :: Load Strings Into Vectors From A File

Apr 17, 2014

I'm working on a project, and I'm trying to fill in various vectors from a given input file. The input file looks like:

<catalog>
<book id ="bk101">
<author>O'Brien, Tim</author> ....etc

My load vectors function looks like this: void load_vectors(vector<string>&id, vector<string>& author...etc)

I can't assume a limit on the number of books etc listed in this catalog, so I'm using the eof() function. However, I don't know how to write the loop to gather the correct strings and place them in the vectors.

Code: while(in.eof())
{ string text;
int index, index2;
getline(in, text);
int index = text.find("<author>");
int index2 = text.find("</author>");
a = index.lenght();
author.pushback[i] = text.substr(index + a, index2);
}

View 3 Replies View Related

C++ :: Load Library - GetProcAddress Return 0 Always

Feb 16, 2014

How to read dll files and i came up with this:

// DLL
Main.h:
#ifndef _MAIN_H_
#define _MAIN_H_
#include <iostream>
#include <stdexcept>
#include <fstream>

_declspec(dllimport) void testfunc( int a );

[Code] .....

Out: testfunc == NULL

What went wrong here?

View 2 Replies View Related

C++ :: Login System Which Load Data From Dat

Apr 20, 2014

I am trying to make a log in system which load data from a .dat .... So I have a part of code below

if(radioButton1->Checked)//Login {
String ^ userAC = textBox1->Text;
String ^ userPW = textBox2->Text;
char ACc[300];
char PWc[300];

[Code] ....

I built it and it is a success but when i run it, it have error: Debug Assertion Failed!

Program:....
File:....Microsoft Visual Studio 10.0VCincludexstring
Line: 930

Expression: invalid null pointer
.......

What is going wrong so i try to comment some part to debug. I found that it come form the code

string AC(ACc);
string PW(PWc);
String ^ ACstr;
String ^ PWstr;
MarshalString(ACstr,AC);
MarshalString(PWstr,PW);

I tried to use std::string and System::string when getting data from .dat but it failed so i tried char array.

View 2 Replies View Related

C/C++ :: Fstream Load Data Function?

Mar 21, 2015

Ive used a similar approach to extract data from a txt file before, however now it seems to crash when i get to the load, below is the code with a NOTE next to where it crashes. This is homework so no code but just information on why it was working for one dataset but not his new one.

/*
The purpose of this program is to read in data and sort with selection and insertion sort. It will read data from file and write to a new file the sorted data
*/
#include <iostream>
#include <fstream>
using namespace std;
bool openFile(ifstream&);

[code].....

View 2 Replies View Related

Visual C++ :: Can't Load 64-bit Key Using RegLoadKey In 32-bit Service

Dec 19, 2012

I need to open up and modify a user's registry key from a 32-bit service (note that the user is not logged in at the time.) I do the following:

Code:
//For simplicity error checks are not shown
//I also made sure to enable the following privileges:
// SE_RESTORE_NAME, SE_BACKUP_NAME

[Code]....

The problem is that the "SoftwareClassesLocal SettingsSoftwareMicrosoftWindowsCurrentVersionTrayNotify" key isn't loaded, even though I know that it exists in the actual user profile. I can verify that by loading the user account and by using 64-bit regedit.

View 5 Replies View Related

C++ :: Load Sokoban Levels From Text File

Jan 2, 2014

I have a group assignment were we need to load sokoban levels from text file. We have loaded the file in a vector but how we can parse the file for it to be used during the game.

We read about malloc and know how to access each character from the vector, but how can we select a particular level after the user inputs an the level integer number?

E.g.

Level 6
# # #
## @#
#####

View 1 Replies View Related

C++ :: OPENGL How To Load A Texture With Alpha Channel

Jun 27, 2014

I'm trying to load a Quad with a Monster Image on it that will always face the Camera, a la Doom 2.

Now I don't know how to load an image with an Alpha part on it.

In 2D using SDL I always used tga files.

Here is my LoadTexture functions.

AUX_RGBImageRec *LoadBMP(char *Filename) // Loads A Bitmap Image
{
FILE *File=NULL; // File Handle

[Code].....

View 2 Replies View Related

C# :: Best Way To Store And Load Image Into Access Database?

Dec 12, 2014

I have:

An Access database in which the picture right now is saved by its directory, together with other field like title, publisher, developer,..

Visual Studio form in which a load button gets that directory as text

Details button that reads the ID of a selected item (I have a list of games) and displays the corresponding picture by reading the directory

The problem right now is that once someone else opens the program on his/her computer, the directory changes, making the whole thing useless.

Is there a way to get around this problem? The books I've been reading don't really adress this.

Directory is a string in class 'Game'; it's short text in the database

private void buttonFoto_Click(object sender, EventArgs e) {
LoadNewFile();
}
private void LoadNewFile() {
OpenFileDialog ofd = new OpenFileDialog();

[code].....

View 9 Replies View Related

C/C++ :: How To Choose Which Picture To Load Using CImg Library

Jul 25, 2014

I've just started using the CImg library and when I try to load a picture with this code:

CImg<unsigned char> image("example.bmp");

It works perfectly. But when I try to type in the image file name using the console it gives me errors. For example, if I try this:

std::string input_file;
std::cin >> input_file;
CImg<unsigned char> image(input_file);

It doesn't work. The way I see it, I should be able type "example.bmp" into input_file and use it but it doesn't work, and gives me the error:

"error: no matching function for call to 'cimg_library::CImg<unsigned char>::CImg(std::string&)"

I have included iostream and string.h.

View 3 Replies View Related

Visual C++ :: CArchive Load Gives Null Lines

Aug 1, 2013

I am trying to reuse some code from my Visual C++ 2005. I am using CArchive to ReadString the first line of a file into another string. However, I am seeing squares where there should be spaces when I view it in the debugger.

Here's the code:

if( cfSAP.GetStatus(csRegExtractFileRemote, cfsStatus)) {
if( !cfSAP.Open( csRegExtractFileRemote, CFile::modeRead, &ef ) ) {
cout<<"FAILED
"<<endl;
ef.ReportError();

[Code] ....

I am not able to read the lines due to this bug ,

This is normal text file contains two lines of information like this

0234568374C186-M-233545 SHAFT MATNUMBER1
0234564565C153-C-349578 BRACKET MATNUMBER2

View 4 Replies View Related

Visual C++ :: Getprocaddress Didn't Load Coinitialize

Nov 22, 2012

I am working to load CoInitialize using getprocaddress, but I don't know why this function fail and cash program! It didn't happen with other functions in other libraries like kernel32.dll. Here is my test :

Code:
typedef HRESULT (*pf)(LPVOID);
pf rf = (pf)GetProcAddress(LoadLibrary(ole32.dll), "CoInitialize");
CoInitialize(NULL); // This line crashes the program!!

why and how to properly load it ?

View 1 Replies View Related

C/C++ :: Hangman Header Files - Globally Declared Array

Mar 4, 2014

I need writing my header files for my program of hangman. I've written what I could, but when I try parts out on their own to see if they work, I get errors. I haven't written my driver yet since I wanted to get this header working first. The first function needs to take the name of the file and read in its contents into the globally declared array. The second function takes no arguments and returns a word from the word list chosen at random. I guess my question is, would what I have so far work, or am I completely off? Here's what I have so:

randword.h
#ifndef _randword_h
#define _randword_h
//static char words[100][50];
/*
*Function: InitDictionary
*This function reads in the dictionary of words and puts them into an array. */
void InitDictionary(void);

[Code] ....

View 14 Replies View Related

C :: Load Up File That Contains Series Of Int Values Stored In ASCII

Sep 23, 2013

This seems like a fairly straight forward assignment. Load up a file that contains a series of int values stored in ASCII and print out the ASCII characters to the console.

The problem I am having is that I am getting the numerical value of bytes ("40" for 10 numerical values, "200" for 50 values). The numbers are generated randomly by another file, but I can control how many numbers are generated. For example, if I type in:

shell% cat tempfile

the output is as follows:

/8?qE?. Y4?(T???a???%@

but when I try to run it with my program:

shell% ./intcat tempfile

the output displayed is:

40

Code:

#include <stdio.h>
#include <assert.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc, char *argv[]){
//check if arguments match

[Code] .....

View 10 Replies View Related

C :: Dynamic Load 3D Model From A File Located In Web Server

Feb 2, 2013

I have done a test, I have edited with the WordPad in Windows on my Local Webserver a file banana.h which contains a list of float arrays in order to extract one array and create a text file named ObjVerts.txt I have done a lot of search in the Web in order to find a small piece of code that can read the text file and convert it to a float array GLfloat, but I did not find any. I have found a lot of piece of code that read the file and make a NSData but many of the code seem to not work. It seem that the last statement return nothing!

NSURL *myurl = [NSURL URLWithString:@"http://localhost/ObjVerts.txt"];
//NSString *mystring = [NSString stringWithContentsOfURL:myurl];
NSData *mydata = [NSData dataWithContentsOfURL:myurl];

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved