C :: Program That Can Implement Functions That Store / Get And Deletes Text / Binary Data To Given Memory Area

Sep 19, 2013

I got an assignment at school asking for a program that can implement functions that store, get and deletes text/binary data to a given memory area. We are supposed to make kind of like a tiny-mini OS..any links to some tutorials or explanations hon ow to understand this and be able to make a program like this on my own?

View 9 Replies


ADVERTISEMENT

C++ :: Widget That Implement Some Matrix Functions Using Data From A Text File

Dec 3, 2014

I need to write a widget that will implement some matrix functions using data from a text file. The input data will be spreadsheet like and fully determined with complete rows and columns. I need to do the following,

1. populate a data structure with the input data (double) to create matrix x
2. transpose the input data matrix x to create x'
3. multiply x * x' to create a square matrix x'x
4. take the determinant of x'x

This is pretty standard linear algebra, but not something I have done in cpp before. Implementation such as the best data types to use to store each of the three matrices, how they are sized, and what library functions may be available for the matrix functions like transpose, multiply, determinant, etc.

I will be removing each data row from the initial input to observe the effect on the determinant in case that has any effect on program design.

View 5 Replies View Related

C :: Program That Deletes Same Lines In A Text File

Mar 23, 2013

I am working on a program that deletes same lines in a text file. I already wrote it, but it still doesn't work.

Code:
#include <stdio.h>
main(){
FILE *f1,*f2;
char oneword[100],filename[25];
int c;
long int i,j;
char *norstring[500000]; /* I count from 1 */

[Code] ....

View 3 Replies View Related

C :: Store Data In Binary File Then Use It To Find Inverse Of Matrix Form Of Data

Dec 6, 2013

I need to find inverse of a matrix data in binary file should be used to form matrix.its not finding inverse correctly rest is working good.

Code:
#include <stdio.h>
void createbin();
void display();
void inverse();
int main()
{
createbin();
display();
inverse();

[Code] ....

View 4 Replies View Related

C# :: Store Data In Memory After Adding Values

Oct 23, 2014

I serialize a XML file, and i have this values here:

public class ServiceConfig {
public List<DatabaseDescriptor> Databases { get; set; }
} public class DatabaseDescriptor {
[XmlElement("Name")]

[Code] ....

I have a form1 which is a datagrid view and get's updated like this:

dataGridView1.DataSource = xmlData.Databases;

Now i have a button: get tables, and it opens up form 2, there it's supposed to appear all the tables of the selected Database, when i click on the row i get the database name so i get all the list of Tables from

DatabaseDescriptor
where
DatabaseDescriptor.Name == name
(I get this when i select the row)

But then on the 2nd form, i also have 2 textbox so i add a new table, i add the tablename and id. the new value should appear in the datagridview of the tables, and when i close it and reopen it, it should be there. Maybe i should concatenate first the values or something, how do i do?

View 3 Replies View Related

C++ :: Add Data To Text Files Which Are Required To Store 3D Scan Data

Jul 10, 2013

I have written the following code to add data to text files which are required to store 3D scan data (I have to calculate the y-coordinate). My code seems to work except that it stops working when I want to create more than ten text files i.e. the directory I am trying to store them in will not hold any more than ten text files. Code is shown below.

#include <string>
#include <locale>
#include <iomanip>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;

[Code] ....

View 1 Replies View Related

C++ :: Capture Incoming Serial Data And Store It Into Array For Controlling Functions

Mar 22, 2014

How to capture incoming serial data and store it into an array for controlling functions. But I am now working with a radio module that receives incoming data and stores it into a uint_8t.

From there in the basic sketch that the radio library came with it is printed in the serial terminal like this:

uint8_t buf[RF22_MAX_MESSAGE_LEN];
uint8_t len = sizeof(buf);
if (rf22.waitAvailableTimeout(500)) {
// Should be a message for us now
if (rf22.recv(buf, &len)) {
Serial.print("got reply: ");
Serial.println((char*)buf);

I have read a lot of tutorials on pointers, and I am just having a very hard time grasping how to extract data out of one. I realize this is char and not integers. The goal is to transmit five integers in a digital state of either 1 or 0, and then store them in the receiving side and control 5 outputs based on the status of those 5 bits. This is proving to be quite confusing for me though as I cannot seem to grasp how to control the pointer logic.

View 1 Replies View Related

C++ :: How To Store Variable In Memory When Program Is Closed

Nov 3, 2013

How do you store a variable in memory so that it isn't changed when the program closes? I don't have any experience with this and am just wondering how it is possible. I am creating a program and want it to store your preferences and scores. In a simple program, everything is just reset and I don't want this for my program. How do I store a variable so that it stays the same, but can be changed even when the program is turned off?

View 2 Replies View Related

C++ :: Printing Data As It Is Stored In Memory (binary)?

Mar 21, 2013

So, if I'm right, computer store their data as binary values. So if I write int x = 5; , my computer converts the value of x from decimal (5) into binary (101) and stores it in memory as a a binary number. If I print that value on the screen that value is converted(by default) back into a decimal number before being printed on the screen.

Now, my question is if there is any way to print the value of x directly into binary(as it's stored in memory) without it being converted back into a decimal value?

View 10 Replies View Related

C++ :: Read Byte Of Char Data And Convert It Into Text String Of Binary Data That Represents Hex Value

Dec 26, 2013

I am writing a program where I need to read a byte of char data and convert it into a text string of binary data that represents the hex value...

i.e. The char byte is 0x42 so I need a string that has 01000010 in it. I've written the following subroutine....

------------- My Subroutine ----------------------------------------------------------------------
void charbytetostring(char input, char *output){
int i, remainder;
char BASE=0x2;
int DIGITS=8;
char digitsArray[3] = "01";

[Code] ....

When I submitted the byte 0x42 to the subroutine, the subroutine returned to the output variable 01000010... Life is good.

The next byte that came in was 0x91. When I submit this to the subroutine I get garbage out.

I am using a debugger and stepped through the subroutine a line at a time. When I feed it 0x42 I get what I expect for all variables at all points in the execution.

When I submit 0x91 When the line remainder = input % BASE; gets executed the remainder variable gets set to 0xFFFF (I expected 1). Also, when the next line gets executed..

input = input / BASE; I get C9 where I expected to get 48.

My question is, are there data limits on what can be used with the mod (%) operator? Or am I doing something more fundamentally incorrect?

View 6 Replies View Related

C++ :: Program That Deletes Two Spaces On Each Line In A File

May 17, 2012

I must create a program (a simple main.cpp in console interface) which deletes two spaces for every newline in a file. If a line has no space, it goes straight to the next line to the end of the file. After the program is to resave the file contents into a new file that has the same name as the old, but change the extension to. Modif

The problem is I can not do that ... Do you have a sample code that does this?

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

Visual C++ :: How To Surround Memory Allocation Area By Try-catch Block

Aug 6, 2013

I am using new operator, I don't recall what the allocator's name is. But what is the corresponding Exception (or derived classes) any try-catch block can cope with?

View 1 Replies View Related

C :: Gradebook Program - How To Store And Access Data

Jun 15, 2013

How I would store all the data. Also how would I access it after I store it. Side Note we are not allowed to use structures or objects.

For the purposes of this gradebook you should first provide a menu with the following options

-Add a new course Add a new student to a course Add grades for a student in a course Print a list of all grades for a student in a course Print a list of all students in a course Compute the average for a student in a course Compute the average for a course Store Gradebook (to a disk file) Load Gradebook (from a disk file)
-Each of these menu items should correspond to a function you will write.
-For the basic program each student will be represented by an ID number And each course by a course number
-Grades will be whole numbers only (no fractional part)

As indicated in the menu you will need to store and load using a disk file so that the data is retained.

Here are so limiting values in defining your data structures: Maximum Number of students (total) 100 Max number of courses 25 Max number of courses per student 4 Max number of grades per student per course 10

View 6 Replies View Related

C++ :: Store Related Data Of Program Into External File?

May 14, 2013

How is it possible to store the related data of a program C++ into an external file (like as .txt) and retrieve it?

I want to write c++ program that can contain data members " id and phone"

like as
Code:
class profile {
private: int id,phone;
public:
void retriever() {
cout<<"Enter your ID: ";
cin>>id;
cout<<"Your Phone number is "<< phone;
};
}

avoiding formats in above class, purpose is to store data already in txt file with different id and phone numbers and it is to be retrieved by matching id number to txt file and viewing its related phone number.

View 1 Replies View Related

C++ :: Making Namespace - Show Variables And Functions Into Compact Area

Sep 13, 2013

I know how to make a namespace i just want to know why someone would. because it just seems like a way to show a bunch of variables and functions into a compact area.

View 3 Replies View Related

C :: Structs - Implement In With Pointers And Functions

Feb 23, 2013

I have a struct and I want to implement in with pointers and functions.

What is the corect syntax? For example:

Code:
typedef struct XYZ
{

int x;
int y;
int z;
}XYZ_t;

int func( using the XYZ_t struct)

[Code] .....

View 5 Replies View Related

C/C++ :: Intuitive Data Structure To Use For Memory Management Program

Mar 21, 2014

I have an assignment that wants me to better understand how certain calls like malloc() and free() work. I'm supposed to have one function that allocates a pool of memory for the program to use (this is the only place where I'm allowed to use the malloc function. Anyplace else is off limits, except when allocating space for data structures.) Another function needs to be defined that allocates memory from this large pool of memory that we have already allocated. A third function needs to free a block of memory when a call from function main is made and a fourth does something else (haven't gotten that far yet.) I'm not sure if it's ok or not, but I'll attach the pdf form that describes all the requirements. If that's not ok, I'll delete it.)

Anyways, when thinking of data structures to use for this particular problem, one doesn't jump out at me as being THE data structure that would be most useful. How I would imagine using it is to store the addresses currently being used as well as the block length of those addresses (so basically, each node of the linkedlist would have a pointer that points to an allocated address and another field that told the size of the allocated block of memory.) How to communicate to the large pool of memory that a certain block of memory has been allocated and shouldn't be used until a free is made on that specific block of memory.

Attached File(s)
pa3.pdf (61.07K)

View 2 Replies View Related

C++ :: How To Implement Main Queue Functions Using Two Stacks

Nov 8, 2014

How to implement the main queue functions Enque() and Deque() using two stacks S1 & S2. You allowed only to call push () and pop() functions of the two stacks to implement Enque()and Deque() functions.

#include<iostream>
using namespace std;
const int size=5;
int arr[size];
int front=-1,rear=-1;
bool isfull() {
if(rear==size-1)

[Code] .....

View 4 Replies View Related

C :: Append Data To Array Of Structures In Memory Then Put In File When Program Ends

Dec 4, 2013

I have a program that stores health information the user inputs, one person at a time. The program works perfectly with the exception of storing the data...I need to open a file and read what health data it has in it already, if any, but store the new changes, and appended data to the array of structures, to the data in memory. All of the information is only saved back in the file once the program terminates. I'm not sure how to go about doing this, so I am also not sure what to put in the function for "Save and Exit" that the user can choose in order to exit the program.

Code:

#include "stdio.h"
#include "stdlib.h"
#include "string.h"
struct strdatabase
{
char first[20];
char last[20];
char gender[2];

[Code]...

I tried playing around with this bit of code, but I'm not sure if I'm even on the right track.

Code:

FILE *fp;
fp = fopen ("students.txt","rb"); fseek(fp, 0, SEEK_END);
long pos = ftell(fp);
fseek(fp, 0, SEEK_SET);
char *bytes = malloc(pos);
fread(bytes, pos, 1, fp);
fclose(fp);

View 9 Replies View Related

C++ :: Implement Member Functions Of Class Function - Failing To Get Input

Aug 17, 2013

I am supposed to implement the member functions of class Person.

class Person {
public:
Person();
Person(string pname, int page);
void get_name() const;
void get_age() const;

[Code] ....

The code I wrote is below. Where I am struggling is the program does not allow me to input age. Therefore, I cannot test if my temp for age works. It automatically defaults to 0 because it hasn't taken input. Here is my code:

// Program Title: Person function
// Program Description: The program prompts the user for first and last name and age.
// It then prints the output that was provided by the user.

#include<iostream>
#include<string>
using namespace std;
class Person {

[Code] .....

View 13 Replies View Related

C :: Possible To Split Command Console Into 2 Parts - Visual And Text Area

Feb 1, 2015

I have had experience in programming from python (slightly related, html/css) and the computercraft from minecraff (basic i think it is).

My question is mainly about the C and past experience with the computercraft.

1. Is it possible to split the command console into 2 parts (a visual area and a text area)
2. Is it possible to use any form of pixel art or custom characters within any command console using C.

View 2 Replies View Related

C++ :: Binary Search Tree - How To Implement Insert Function Properly

Nov 18, 2013

I am unable to implement the insert function properly, every time i run the program i just get the first value and name, I am not getting other Id's and name.

"(Header File)"
#include <iostream>
#include <string>
using namespace std;
class node{
public:
int ID;
string name;
class node *left, *right, *parent;

[Code] .....

View 4 Replies View Related

C :: Program To Read Binary Data And Print It - File I/O Error

Mar 14, 2013

Objective of this program is to read binary data from a file and print it.

Code:
#include <stdio.h>
void readFile(void);
int main(){
readFile();
return 0;

[Code] .....

But When I Run This Code First It Print "Error." Then Rest Of The File.Say In My File I Have "I AM HUMAN", It Prints "Error. HUMAN"!!

I Cant Figure Out Whats Wrong In The readFile() Function.It seems right to me.

View 4 Replies View Related

C++ :: Creating Binary Tree Program - Allow User To Input Data Types

Apr 23, 2013

In class we were asked to create a C++ BTree program that would allow a user to input the following data types and then store said data in a .txt file:

0. ID 8 bytes

1. First name 30 char

2. Last Name 30 char

3. Street Address one 30 char

4. Street Adress two 30 char

5. City 30 char

6. State 20 char

7. Zip 10 char

8. Country 30 char

(I'm not particularly asking for full code, pseudo code would also be great). I had a great deal of my work done, unfortunately, the computer I was working on crashed, corrupting my files.

View 4 Replies View Related

C++ :: Calculation Of Rectangular Area - Adding Data To Console

May 31, 2014

I wrote a little program. I'd like to calculation of rectangular area. How can I add data to the console?

Code:
#include <iostream>
using namespace std;
class Teglalap {
protected:
double hossz;
double szelesseg;
double terulet;

[Code] ....

But it is wrong. Nothing happen. Which line is wrong?

View 2 Replies View Related







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