C :: How To Make Text File Of Bits Stored In AVI / Binary File

Feb 5, 2014

I need to create a program which could create text files of the bits stored in avi file/binary file. My first requirement is to show 0s and 1s in the text representation . My second requirement is to create an avi file from this text file. I have tried few codings but either they give me error or they not playing the reconverted binary files.

View 6 Replies


ADVERTISEMENT

C/C++ :: How To Write 0 Or 1 To Binary File In Bits Not In Bytes

Aug 20, 2014

How I write a 0s or 1s to binary file in bits not in bytes how can i do that ???

View 2 Replies View Related

C++ :: Saving Text Stored In Array To TXT File?

Sep 2, 2013

how to save text stored in an array to a txt file. can sum1 how to save the text in an array to a file/txt file......

View 7 Replies View Related

C++ :: Multiple Quiz Program - Adding High Score For Each User Stored In Binary File

Jul 11, 2014

I am making a multiple quiz program. So everything is working fine, except for the part where i'm trying to add a highscore for each user which is being stored in a binary file. I have added a sample of the program containing the error. This isn't the actual program, which is very long.

class user { //The collection of all info pertaining to the users
char user_id[50];
public:
int hscore1;
user() {
strcpy(user_id,"NULL");
hscore=0;

[Code] ....

View 1 Replies View Related

C++ :: Convert Text File Containing 0 And 1 To Binary File

Apr 15, 2014

I just wrote a program for Huffman Encoding, where I take a text file, encode it in the form of 0's and 1's, and save that as another text file. However, this does not solve my purpose as it is taking even more space.

So I want to know how do I convert a text file containing these 0'S & 1's to a binary format.

Here is my program:

#include <stdio.h>
#include <string.h>
#include<fstream>
#include<string>
#include<iostream>
using namespace std;
typedef struct node_t {
struct node_t *left, *right;
int freq;
char c;

[Code]...

View 1 Replies View Related

C :: 16bit Samples Stored In Shorts - How To Reduce Bits

Dec 8, 2013

16bit samples stored in shorts how i can reduce bits ? i meann idea not sources. i try learn code itself (i not school but i still dont want premade solutions for this)... i mean way make 16bit sample sound for example 4bit/8bit... and these are are audiosamples.

View 8 Replies View Related

C++ :: Text File To Binary File

Sep 14, 2013

I want to convert a text file into binary file. I should create the text file by myself. I also use a structure for the components:

struct Data
{
int num;
char name[30];
};

I write information in the text file like this:

Data d;
cin >> d.num >> d.name;
fstream file("Name.txt");
file << d.num << d.name << '
';

If I have entered:
3 Steve
is easy to get this data. I just make another variables and get the data in them:

int num2;
char name2[30];
file >> num2 >> name2;

And everything is done. But what if I have this:

cin >> d.num;
cin.getline(d.name, 100);
file << d.num << d.name;

and the input is:
5 Steve Brown

I can get the number easy like before but how can I get the whole name? If I use:

int num2;
file >> num2;
char a[30];
file >> a;

I get only the first name "Steve". Can I get somehow and the second name in the same variable?

View 12 Replies View Related

C++ :: How To Make Sentence A New Paragraph In Text File

Oct 30, 2014

I have to modify my output text file and convert every sentence into paragraph. I ran it its copying whole text but not paragraph after dots.

#include <iostream>
#include <string>
#include <fstream>
#include <cctype>
using namespace std;
void copyText(ifstream& intext, ofstream& outtext, char& ch);

[Code] .....

View 2 Replies View Related

C :: How To Make String Array From Strings In Text File

Mar 24, 2013

I want to make a string array from strings in a text file. Itry to do this but i couldn't do, where is my mistake?

Code:

#include <stdio.h>
#include <stdlib.h>
int main(){
char cumle[100],*c,*dene[50];
FILE *input;
input=fopen("input.txt","r");

[Code]...

View 1 Replies View Related

C/C++ :: Make A Room File Writer For Text Adventuring?

Mar 1, 2015

I'm attempting to make a room file writer for text adventuring. I compartmentalized each variable for the stream, and dealth with the buffer over runs and all that. Now what I would like to do is make the "get_shdesc" function cut it's lines off at the last white space before it hits the 80th character and continue on the next line. I have no errors, and it functions properly so far.

1. Am I attacking this program in the proper manner so far?

2. If not, what should I be doing?

3. If so, what specifically should I read and study on to get the word wrap effect I am looking for.

My code thus far is:

#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>

[Code]....

View 3 Replies View Related

C++ :: Writing Text Data To A Binary File With Fstream

Jul 9, 2014

fstream ifs;
ifs.open ("data.str", ios::binary | ios:ut);
char *data1 = "data1";
char *data2 = "data2";
ifs.write(data1, strlen(data1));
ifs.write(data2, strlen(data2));

when i this,data2 is not going under data1, i thought each write starts on a new line?

View 4 Replies View Related

C++ :: How To Convert Text File Into Binary And Vice Versa

Dec 25, 2013

The problem is that I want to write a C++ program that converts an ordinary text file into binary and then reads that binary file and converts it to text file so that this text file equals to first text file. I have wrote this code for it.

int main() {
string name1 = "first", name2 = "sec", name3 = "third";
int j = 0, k = 0;
ifstream ifs(name1.c_str()); // Here I want to read from the ordinary text file (name1).

[Code] .....

Now what the ofs.write(as_bytes(j), sizeof(int)); or ifs.read(as_bytes(k), sizeof(int)); exactly mean?

In practice, the file name1 contains digit 5 and its size is 1 byte. The name2 contains some character/sign like [] and its size is 4 bytes and name3 contains digit 0 and its size is 1 byte, why? I before have created the name1 file in ordinary text file mode.

My machine is Windows 7 32-bit. My compiler is MVS 2012.

View 9 Replies View Related

C++ :: How To Convert Ordinary Text File Into Binary And Vice Versa

Dec 23, 2013

How to convert an ordinary text file into binary and how to convert that binary file back to a text file so that the first text file equals with the last text file?

View 8 Replies View Related

C :: Binary File Write By User Input Then Printing Binary File Data Out

Dec 6, 2013

Following is the program I wrote it basically takes 9 inputs and then save them into binary file. then print out the data stored in binary data and find inverse of it then print the inverse out. but its stuck in a loop somewhere.

Code:
#include <stdio.h>
int main() {
int a[3][3],i,j;
float determinant=0;
int x;
FILE *fp = fopen ("file.bin", "wb");

[Code] .....

View 6 Replies View Related

C :: Original Text File / Generate Another File With Text Content In Upper Case

Nov 29, 2014

Code software that, from an original text file, generate another file with the text content in upper case.For exemple:

entrence:

luke
tom
alex

outings:

LUKE
TOM
ALEX

My code so far:

Code:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
}

[code]....

View 2 Replies View Related

C :: Version Number Stored In EXE File

Feb 24, 2015

I am/we developing in C and we have a number of different programs. We also have problem to keep track of different versions of a specific exe file.

Is there any way to add version number when build a file so the version is added in the properties.

I doing this in a MFC c++ project in a .rc file. Is there a way (or a similar way) of doing this in C? Here its stored in the details section with product version 6.0.8:

View 6 Replies View Related

C++ :: Value Not Stored Into Vector After Reading File

Oct 21, 2013

Reposting this as I deleted my pervious post because I missed out some parts of the codes.

I am trying to read a textfile containing some informations in this format,I am able to extract everything except the itemId.

View 2 Replies View Related

C/C++ :: How To Validate Data Stored In A File

Jun 21, 2014

I am trying to build a employee management system using C, and I have done alot so far. Everything seems to work fine, but then I thought that I should let the user store the data of their employees permanently, therefore I created a file and then I store the user's given data in the txt file.

Here is the code:

#include<stdio.h>
#include<conio.h>
#include<string.h>

[Code].....

But there is some problem, and I don't seem to understand what is the problem in the code, it's just that whenever the user enters any id to search, and presses any key then nothing appears just a blank screen! I wanted to know that how can I check the ID from the text file and then display the details of the employee of that id!

View 1 Replies View Related

C Sharp :: Create Xml File From Xml Stored In A DB

May 15, 2013

I have a table in my database that has a 3 fields.

RuleID | RuleName | Rule

the ruleID is a randomly generated string of characters, RuleName is the name the user gives to the rule, and the Rule field is about 600 characters long and is just XML text.

I want to read that Rule field from the database and use it inside the function below.

private static List<MenuItem> LoadRules(bool evaluationType)
{
//string path = HttpContext.Current.Server.MapPath(string.Format("/Rules/{0}/{1}/", ip, evaluationType ? "Evaluation" : "Execution"));

[Code]...

This function loads an xml file from a static location and parses out some information to a context menu.

BUt i'm culeless on how to have the function read the xml info found inside my database.

View 1 Replies View Related

C :: Read Data File And Emit Various Bits Of Information

Mar 31, 2014

For my intro to c programming class, our homework requires us to read a data file and emit various bits of information. the data file looks like this

#Domain: the URL
#Alexa: some kind ranking, small numbers are better
#Rank: another sort of ranking, big numbers are better

#Domain Alexa Rank Site Name
#------------ ----- ------- ---------
amazon.com 13 1177136 Amazon.com
google.com 1 4533883 Google
youtube.com 3 3637788 YouTube

[Code] ....

I've started and am able to get the correct number of lines, and the alexa number, but I keep getting some errors and am just unsure where to correct my code. This is what it looks like;

Code:
// Lexi Anderson
//CS 156
#include <stdio.h>
int main() {

[Code] .....

and once compiled, I get errors.

View 7 Replies View Related

C :: Decimal To Binary Converter (8-bits)

Sep 9, 2014

I was trying to program an decimal to binary converter (8-bits) in C. I am a complete beginner so I tried to put the 1's and 0's of the binary number as they come without reversing the order for beginning. I have seen example on the internet but didn't understand them so I decided to write it as I understood it. So, I typed the code as shown below:

Code:
#include <stdio.h>
#include <stdlib.h>
int main() {
int number;
int BitNum[8], x;

[Code] ....

The problem with the code is that if binary form has 0s in it then program displays a random number instead of a 0. For example if decimal is 7, it should print out 11100000 but it displays only 111(and some stupid numbers instead of 0). I have tried to solve it but failed.

View 7 Replies View Related

C :: How To Compare A String With A Set Of Strings That Have Been Stored In A File

May 5, 2014

I am trying to compare a string that i have entered with a set of strings that have already been stored in a file. I am using strcmp function but i am not getting the result.

Code:
printf("
Enter string:");
scanf("%s",&m);
ptr_file =fopen("abc.text","r");

[Code] .....

View 10 Replies View Related

C/C++ :: Use Global Variable Stored In File In 2 Different Functions?

Mar 13, 2014

Ok so when the program runs the first function the data is stored and displayed in the file. The second function is supposed to read the name entered, compare it to the ones in the file then take the price with it BUT I seem to have done something wrong when reading the files (or maybe it has to do with the global function I'm not sure). Here's parts of the code :

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>

[Code]....

View 7 Replies View Related

C/C++ :: Print Binary Numbers From 0 To M - Size N Bits

Apr 26, 2014

I need writing a program that print binary numbers from 0 to M.

Size N bits.

Ascending or descending order according to user choice.

When the default is M = 8, N = 3

View 5 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 :: File Existence Check And Ask To Make Another File And Rename

Mar 24, 2013

I have this code to check if file exist already and its work, but what i need is : is to add feature to function to see if the file already exist open same file and rename it with another name ,probably file2

assume file name is "abc.c"

This scenario like this

User>>(provide file name)

Code>>(check if file already exist show msg:

"File already (abc.c) exist would you like to create another file and rename it ("abc2.c") "maybe it need loop to search directory "????

User>>if press yes ok it will make another file with another name but if no exit the function and dont create another file

Code: // function to check file existence and here what i need to add the feature above

int fExist(const char* fn){
struct stat buffer;
int exist = stat(fn,&buffer);
if(exist == 0)

[Code] .....

View 2 Replies View Related







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