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


ADVERTISEMENT

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 View Related

C++ ::  How To Store Memory Address In A Pointer

Apr 29, 2013

What I'm trying to do is:

int *p;
someType memoryLocation;
cout<<"Enter your memory location: ";
cin >> memoryLocation;
p = memoryLocation;
cout << *p;

I was just messing around with some code, and was curious to if this was possible.

View 6 Replies View Related

C :: How To Store Array Of Structure At Shared Memory

Jan 16, 2014

I have one requirement to store an array of structure at shared memory. Also the shared memory should have one counter to store number of elements in the array.

I tried to look at some placed but didn't find anything relevant.

So my first question, is it possible that we can store two things on same shared memory. And second if not then how to achieve the same?

View 5 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 :: 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++ :: 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++ :: Class Memory Allocation - Store Number Of Elements In Table

Mar 31, 2013

Say I have a class with a few member functions, and only two data members: an int* Table; and an int Size;, to store the number of elements in Table.

I'm using a copy constructor that takes in two parameters: int* table, int size. In this case, is the address that table points to the same address as the object that table is part of? And furthermore, is it possible to say table.Size? I want to compare the passed array's size to the passed size.

View 2 Replies View Related

C# :: Store Multiple Values?

May 1, 2015

I am working on a text based RPG. As with most RPGs the character has attributes that grant modifiers. Lets take strength for instance. Suppose the character can have a strength score that ranges from 1 to 10. Based on strength the modifiers could be like the following:

Strength = 1 grants +1 to hit and +1 damage
Strength = 2 grants +1 to hit and +2 damage
Strength = 3 grants +2 to hit and +3 damage

I want to set these values at design time and be able to retrieve the modifiers based on the strength value from multiple places in my program.

What is the best method of designing this. I looked around online and saw references to Lists with Tuples and Dictionaries with Tuples but these did not seem to be a very efficient way of handling the scenario above.

View 4 Replies View Related

C/C++ :: How To Store Values From A File To Array

Nov 21, 2014

I'm trying to read values from a file to store them in an array in C++ and then output the values in a table format for everyday of the month: morning, noon, evening and night. My text file looks something like this:

38
210
14
3
214
222
82
176
225
.
.

#include <iostream>
#include <string>
#include <cctype>
#include <fstream>
#include <sstream>
using namespace std;
struct dailyReadings{

[Code] ....

View 1 Replies View Related

C/C++ :: How To Store Big Values Either Int Or Floating Like PC Calculator

May 29, 2012

I just wanted to know how to store big numbers (like more than 20 digit values) in a variable?

For those type of big values, whether float variable is good or int variable is good?

And finally, all these challenges i am facing in the process of coding for an application which contains calculator and it should give the accurate results as our windows pc calculator.

View 3 Replies View Related

C++ :: Adding Up Values Of Dice Rolls In A While Loop

Feb 19, 2013

I'm having a problem adding up the values of the dice rolls in a while loop. The program will only store the last value so how would I get it to store multiples values? Here is my program thus far. I would try an array but we haven't gotten to that yet.

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main() {
int die_1=0, die_2=0, total_score1, total_score2, player1score;
char enter;

[Code] ....

What operators or equation I should use to accomplish this?

View 7 Replies View Related

C++ :: Can't Store Different Values Into Vector By User Input

May 4, 2013

I can`t seem to store multiple values into my vector when a user keys in an input. Lets say a user inputs 1,2 as the first set and later keys in 3,4.

My vector gets overridden by 3 and 4. I'm trying to pass these values into a function to store them into a vector and use them in the function.

Below is my code snippet

int reconstructSecret(int x, int y) {
int getX,getY;
getX=x;
getY=y;
vector<int> myXCordVec;
vector<int> myYCordVec;

[Code] .....

View 6 Replies View Related

C++ :: Values Getting Stuck In Memory?

Apr 4, 2013

I have a school project where I have to create a class with 2 attributes that default to 1. To verify that they are at 1, I have a cout before any user inputs or value manipulation. It works for the most part. What happens is that if I change the defaults to 17, the cout will retain the old values until I have an unsuccessful build (remove a semicolon from the end of the line). When I have a successful build (put that semicolon back), the cout displays the changed values. Change the values back to 1 and the same thing happens again until I have an unsuccessful build then a successful build. Are the old values getting stuck in memory somewhere?

// Rectangle.h
// Chapter 9_Problem 9.11_Page 412
#include <iostream>
using namespace std;
#ifndef RECTANGLE_H
#define RECTANGLE_H
class Rectangle // Rectangle class {
public:
Rectangle(double = 17, double = 17); // default constructor setting values to 1

[code]....

View 10 Replies View Related

C :: Read From And Store Values Of Each Line In Multiple Variables

May 6, 2013

So I have this text file that I am trying to read from and store the values of each line in multiple variables. Let's say my text file contains

AXSYZ3482 Tom 100 112 and my code below here works fine when the lines in the text file is separated by spaces.

Code:

while (fscanf(fp, "%s %s %d %d
", userID, name, &startLoc, &endLoc) != EOF) {
printf("%s %s %d %d
", userID, name, startLoc, endLoc);
}

But let's say my file was to look like this instead.

AXSYZ3482:Tom:100:112

But if i try this below...

Code:

while (fscanf(fp, "%s:%s:%d:%d
", userID, name, &startLoc, &endLoc) != EOF) {
printf("%s %s %d %d
", userID, name, startLoc, endLoc);
}

It seem to store the entire line in userID including the ":". I want to ignore the ":"'s and store everything in between in respective varibles in the order specified above.

So first string in userID, then ignore the :, then second string in name, and ignore the next :, and so forth.

View 4 Replies View Related

C :: Read Specific Values From A File And Store Them In Arrays

Apr 14, 2013

What i try to do is to write a code which reads some specific values from a file and stores them in an array. My File looks like this

Code:

XFOIL Version 6.96
Calculated polar for: Myfoil
1 1 Reynolds number fixed Mach number fixed
xtrf = 1.000 (top) 1.000 (bottom)
Mach = 0.000 Re = 0.200 e 6 Ncrit = 4.000
}

[code]...

View 11 Replies View Related

C++ :: Take Values From Text File And Store Them In Variable And Use For Later Calculation

Nov 8, 2013

I have a text file in the form

5502 5202.3
1523 2536.1
1254 1256.2
17846 8956.2 and so on

left one is time and right one is pressure, I need to show the time value as it is but i need to use the pressure value to calculate air speed. I don't know how to use the strings to pick up the list properly. I did the calculation formula for the air speed but i can't pick the pressure value up from the text file. here's what i did:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

[Code].....

View 3 Replies View Related

C++ :: Reading From File And Store Values Of Each Line In Multiple Variables

May 6, 2013

So I have this text file that I am trying to read from and store the values of each line in multiple variables.

Let's say my text file contains

AXSYZ3482 Tom 100 112

and my code below here works fine when the lines in the text file is separated by spaces.

while (fscanf(fp, "%s %s %d %d
", userID, name, &startLoc, &endLoc) != EOF) {
printf("%s %s %d %d
", userID, name, startLoc, endLoc);
}

But let's say my file was to look like this instead.

AXSYZ3482:Tom:100:112

But if i try this below...

while (fscanf(fp, "%s:%s:%d:%d
", userID, name, &startLoc, &endLoc) != EOF) {
printf("%s %s %d %d
", userID, name, startLoc, endLoc);
}

It seem to store the entire line in userID including the ":". I want to ignore the ":"'s and store everything in between in respective varibles in the order specified above.

So first string in userID, then ignore the :, then second string in name, and ignore the next :, and so forth. How I can accomplish this?

View 2 Replies View Related

C Sharp :: Store Values In Variable Permanently Even After Restarting Machine?

Dec 26, 2013

I want to store values permanently in a variable. The same variable should be able to be edited and saved by user, and whatever it is I need the value of the variable from the last time I modified it, like a database. database because i need this to set my connection string of the database.

View 1 Replies View Related

C++ :: Assign Values To A Dynamic Memory Structure?

Dec 27, 2014

I create some code that assign values to a dynamic memory structure. I'm not sure why one code works and the other crashes when it assigns a value.

Working Code

#include <iostream>
using namespace std;
struct WorldOjectCollisionMap
{

[Code].....

View 6 Replies View Related

C++ :: Initializing Pointers To Memory Addresses Or Values?

Aug 31, 2014

What is the difference between initializing pointers to a memory address using the address operator like int *pointer = &x; or initializing it to a value like int *pointer = x; .. in other words how does p and q point to the same memory address in:

const int ARRAY_LEN = 100;
int arr [ ARRAY_LEN ];
int *p = arr;
int *q = &arr[0];

View 4 Replies View Related

C :: Display Current Time And Date In Program And Use Variable To Store Each Of Values

Feb 16, 2013

i need to display the current time and date in my program and use variable to store each of the time values like

a = 10
b = 29
c = 31

printf(``%d : %d : %d``, a,b,c);

which then give the output as - 10:29:31

How to save the time in variables in C....

i am using C in windows 7 and my complier is Bloodshed Dev C++

View 7 Replies View Related

C/C++ :: Madd Libs Game - How To Store Inputted Strings Or Values To Arrays

Nov 11, 2014

My assignment is writing Madd Libs game. I still do not understand how to store inputted strings or values to arrays. I need explanation of collecting inputted data to arrays.

#include "stdafx.h"
#include<stdio.h>
//#include<string.h>
int main(void) {
char string[37] = {''};
char adjective1[15];

[Code] ....

View 14 Replies View Related

C Sharp :: Linq - How To Group Values Week Wise And Store In Another Datatable

Apr 9, 2013

I have a datatable which comprises values from 1st January to march, something like this:

DataTable datatable = new DataTable("Employee");
datatable.Columns.Add("Date", typeof(string));
datatable.Columns.Add("Employee", typeof(string));
datatable.Columns.Add("Job1", typeof(double));
datatable.Columns.Add("Job2", typeof(double));  
datatable.Rows.Add(new Object[] { "1/4/2013", "A", 1.3, 2 });

[Code] ....

The result should look like this for Job1:

Employee 1/7-1/13 1/14-1/20 1/21-1/27 1/28-2/3 and so on...
A sum of values for this 7 days
B
C
D

I want to add all the values of Job1 for each employee in a time range which is one week starting from monday to sunday. How can I group the Job1 values week wise and store them in another datatable.

View 4 Replies View Related

C++ :: Best Way To Store Data?

Jul 8, 2013

struct Book{
string bookTitle;
string ISBN;
string author;
string publisher;
string dateAdded;
int qty;
double wholesale;
double retail;
};

What's the best way to store multiple of the above structure?Ideally, it would be with a binary output, but that isn't possible with the strings, unless I'm missing something. So that leaves me with two options.

-Create a second structure that has an outrageous char[] length, and then copy the data from the original structure to write/read to/from the file. The flaws I see in this is excess runtime with copying, and a larger amount of memory is temporarily needed. The positive I see is I can use binary output, which is easier.

-The second option is to just use an ASCII file, and put each element on it's own line, and then just use getline to read each line. The flaw I see in this is that I have to read the file into the structure, instead of just reading the structure and the file can be tampered with (Not a huge concern). The positive is the lack of negative from the above.

View 4 Replies View Related

C++ :: Correct Values Passed To The Pointers - Memory Corruption

Apr 26, 2012

My project is say that it has memory leaks. When I view it in the debugger, it shows the correct values being passed to the pointers.

Code:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
bool ConfigGetEntry( char *pcFile, char *pcNameMust, char* &pcResult ) {
char pcBuffer[ 512 ];

[Code] ....

Its saying that i have memory corrupting at..

Code:
if ( !ConfigGetEntry( pcFile, pcName, pcRet ) ) return _strdup( pcDefault );

Also is it normal to have a bad pointer then point data into it to then clear that of the bad pointer. To have valid data now in that pointer.

View 3 Replies View Related







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