C :: Display Pointer Content
Oct 30, 2013
I wrote a code and I found a small problem with the display of the pointer
here is the code :
Code:
#include <stdio.h>#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
[Code]....
View 5 Replies
ADVERTISEMENT
Dec 17, 2014
I need to display all the content of the ( codedParams & modeParam ) in the next piece of code
struct SAOOffset {
SAOMode modeIdc; // SAOMode is an enumerator
Int typeIdc;
Int typeAuxInfo;
Int offset[MAX_NUM_SAO_CLASSES];
SAOOffset();
~SAOOffset();
Void reset();
const SAOOffset& operator= (const SAOOffset& src);
[Code] .....
View 1 Replies
View Related
Mar 3, 2014
When we are using RAM DISK - the files are stored on the RAM. From what I understand (and saw many examples) in order to read data from file (the file which locate on the RAM) - I need to use the read function.
Is there a chance to get char* (or any pointer) to the content of the file without using the read function ?
If the file locate on the RAM, it seem that it is like I have a buffer on the RAM (like an array which was dynamic allocated) and in the case of a buffer on the ram -> we can use pointers to the data without reading all the data.
example:
class CDATA {
int nValue1;
int nValue2;
double dValue3;
double dValue4;
char achBuf[10];
[Code] .....
View 2 Replies
View Related
Jan 31, 2014
I've got a problem with a piece of code that it doesn't seem to work anymore.
Code:
#include <stdio.h>
#include <conio.h>
main () {
[Code] ..... i
I chose a to be 5 and it displays the following:
"Type a value for a:
5
5 in octal is: 5
5 in hexadecimal is: 5
Process returned 23 <0x17> execution time : 1.031 s".I first saw this when trying to display the address of a pointer. Am i missing something? I used to run this code on dev-c++ successfully but after a day or so of practice, it's not working anymore. I switched from dev-c++ to code blocks.
View 5 Replies
View Related
Feb 12, 2013
I am using pointer to display values of an array but its output is not correct example 23424,0, -323423 etc... whats the problem with my code:
Code:
#include<stdio.h>
#include<conio.h>
int main() {
clrscr();
int arr[10][10],rows,cols;
int* ptr;
[Code] ....
View 4 Replies
View Related
Jan 7, 2014
In a C++ map, is there any way to search for the key given a content? Example:
I have this map:
map<int,string> myMap;
myMap[0] = "foo";
Is there any way that I can find the corresponding int, given the value "foo"?
cout << myMap.some_function("foo") <<endl;
Output: 0
View 3 Replies
View Related
Apr 3, 2013
I am using c to read and write contents of a file into other:
FILE *ptr;
status_t status;
uint32_t block_size, result;
uint32_t num_blocks;
char temp_buffer[1024];
}
[code]....
Is there way to see the binary content of this file.
View 2 Replies
View Related
Apr 20, 2014
I'm trying to create an appointment time table.
I used a ListBox with each ListBoxItem representing 15 minutes. Now I want to add some kind of label/picture next to the Listbox to indicate the hours.
What I did was I got rid of the scrollbars and scrolling ability of the ListBox and I heightened to the max. THen I added it into a Scrollviewer to scroll up and down.
Now I also have a StackPanel with TextBlocks. Each TextBlock is an hour label.
I want to put that StackPanel into the Scrollviewer as well so it can scroll alongside the ListBox! But it seems the Scrollviewer can only have one "Content" in it.
A picture of my program:
Link to Dropbox pic
Here is my XAML so far:
(In this code my StackPanel is actually currently in Scrollview. I want to add my ListBox in as well...but I can't... />/>
<Grid>
<ScrollViewer Height="444" Width="350" Margin="834,145,10,182">
<StackPanel Height="1440" Width="101" HorizontalAlignment="Left" VerticalAlignment="Top">
[Code].....
View 3 Replies
View Related
Sep 3, 2014
In this example code:
Code:
printf ("
Type in 1st address: ");
scanf ("%x", &address1);
address1 = (address1 - number1) * 2;
printf ("
Result = %08X
", address1);
How can i copy the contents of var address1 onto the clipboard?
View 8 Replies
View Related
Feb 17, 2014
how can i write a contact manager system(CMS) in c ?
View 2 Replies
View Related
Aug 12, 2013
I'm makeing a card game with ncurses. I have all the card and player objects in order but i'm stuck trying to get the gui to work.
I'm using multiple windows for different players deck and pile. Now to the problem: I can get all the windows to show with borders in the console but i can't get any content printed in the windows and I rally can't see why!?
I have been reading the guide on [URL] but I don't get any further on the problem right now.
PS. the complete code incl. Makefile can be found at:
github.com/DanBrehmer/cardGame
#ifndef GUI_H
#define GUI_H
#include <ncurses.h>
[Code]....
View 3 Replies
View Related
May 23, 2013
I'm trying to write a program that prompts the user to enter a math expression (i.e 2*x + x*x) and a value of x. Then generate the value of y. My real question is: Is there a way to put the content of a string into the source code?
Example:
string math_function;
double x, y;
cout << "Enter the function: ";
getline(cin, math_function);
[Code] .....
View 4 Replies
View Related
Apr 2, 2015
I have this class, Prenumeratorius, it represents a subsriber in this context. Then I have a class Leidinys, which represents a newspaper:
class Leidinys {
private:
string kodas;
string pavadinimas;
double vienetoKaina;
[Code] .....
So in while loop it just reads data, Then I create Prenumeratorius object and store data in it, then I want to add it to correct place by using DėtiPrenumeratorių(), I will show it's content in just a moment. And the last method call - I just add element to another two way list of all subscribers.
So here is content of DėtiPrenumeratorių():
void LeidiniuSarasas::D/>ėtiPrenumeratorių(string kodas, Prenumeratorius &P) {
for(LeidiniuMazgas *dd = p; dd != NULL; dd = dd->Pirmyn()) {
if(dd->Imti().ImtiKodą() == kodas) {
dd->Imti().DėtiPrenumeratorių(P);
}
}
}
It just loops through all newspaprers and searches for the match. I actually tested this method, it works just fine, the problem is one step further:
As you can see, it calls another DėtiPrenumeratorių() method, this time that method puts Prenumeratorius in the vector I showed at the beginning.
The problem is, that when that method is over, vector's content dissapears, I debuged program and saw that, but I can't recognize what is wrong, I added & to all of my method's headers where it accepts that Prenumeratorius object. The same algorithm used to work with one way list.
View 4 Replies
View Related
Nov 14, 2014
Is there member functions for STL's like vector,list etc., to shuffle the content of that STL.
eg:
int arr[] = {1,2,3,4};
std::vector<int> v1(arr, arr+ sizeof(arr) / sizeof(int) );
now i need to shuffle the data randomly like
Now vector may contain {3,2,4,1} or {2,1,4,3} ...
I have taken vector as an example. let me know if there is any alternative way with other STL's
View 2 Replies
View Related
Sep 18, 2013
A user enters a query and other users reply to it. But it creates a problem here. After adding queries, if I wish to reply to query in between then it adds a redundant entry in file. 1st entry is the original query without reply and 2nd entry is the same query now with a reply added. I want only 1 entry of the query along with replies.Here is the code:
Code:
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include "var.c"
int check_count();
void add_query();
void add_reply();
}
[code]....
View 9 Replies
View Related
Sep 24, 2013
I'm trying to read all content from a text file into a string. This is the code I'm using for it (I know there are other, maybe better ways to do it but I'd like to stick to this for now):
char* buffer;
std::string data;
FILE* fp = fopen("textfile.txt", "rb");
if (!fp) {
printf("Can't open file");
[Code] ....
So my problem is that I get an exception when I try to free the memory -> 0xC0000005: Access violation reading location 0x51366199
I even get the exception when I try to free it immediately after calloc() but why this is.
And if I use buffer = (char*)malloc(lSize); I don't get any exceptions.
So, why this fails and what I'm doing wrong.
View 14 Replies
View Related
Jan 28, 2013
I would like to store the entire content of a file in a single c-string variable or in a standard string class variable. Is there a function that will do this for me? I am familiar with functions that get one character or one line at a time but I don't think I've encountered a function that gets the entire file. Does this function keep or disregard the end-of-line character? If no such function exists, I would write my own function to create and return such a variable.
View 4 Replies
View Related
Jan 13, 2014
In my program I have to load a page in a second window based on user's decision. This is how I do it:
case 1:
Page1 p1 = new Page1();
secondwindow.frame.Source = new Uri("p1.xaml", UriKind.Relative);
secondwindow.Show();
break;
case 2:
Page2 p2 = new Page2();
secondwindow.frame.Source = new Uri("p2.xaml", UriKind.Relative);
secondwindow.Show();
break;
The user should not be able to navigate between these two pages, and between choosing one or the other page, the user will have some interaction with the main window. For the user interaction with the main window, the second window gets hidden:
if (secondWindow != null)
{
secondwindow.Hide();
}
Now if the user selects the first page and and then the second page, when I show the second window, I can see the first page for a fraction of a second, and then second page gets rendered. I wanted to know if there is a way to make sure the rendering is complete before using:
secondwindow.Show();
View 5 Replies
View Related
Jun 2, 2014
I've attached an image that shows a basic table with dynamic content in the header.
Initially, I thought about using a datagrid. However, I can't use a datagrid because of the format of my data visually. The DataGrid would not allow me to have static and dynamic data inside my column headers.
You see anything I am displaying in brackets, {}, are being updated with results after I process some data in the backend. After the data analysis is done, the results are displayed based on an algorithm.
So, let's say for control1, for each family, it would indicate whether the data passed or failed. Then, in the rows themselves, it would update with choice 1 or choice 2 depending on the data generated.
So, the data that is in brackets shows properties being updated. I'm not sure what UserControl I can use to accommodate this kind of display.
View 13 Replies
View Related
Jun 8, 2014
I need to develop a simple program, i have 2 variables (begin, end), and i need to search in a file, And extract the string between the Begin and the End variables to a new File, For Example:
my text file: file.txt:
some text here<StartHere>more text here</EndHere>text text
C++ Program:
//Declear 2 variables
strcpy_s(begin, string("<StartHere>").c_str());
strcpy_s(end, string("</EndHere>").c_str());
//And now, search in the Text file, And Extract the text between the begin string and the End string.
<...>
The Result should be: NewFile.txt with the content:
<StartHere>more text here</EndHere>
That's it!, Here is what i have for now:
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int main() {
int ocurrences_count = 0;
int ocurrences2_count = 0;
char word[20]; //this array will save user input
[Code] ....
View 1 Replies
View Related
Feb 8, 2014
I am trying to write a program for a library system that allow stuff to add, remove, view and delete customer. i try to use file to store data and i open the file in mode read then i store then i put the content of the file into a structure. now the problem started it is only showing me haft of the content and here is the coding.
#include <stdio.h>
# include <windows.h>
# include <stdlib.h>
#include<string.h>
#include<conio.h>
void search(int s,struct books eli[20]);
void view(int x,struct books eli[20]);
[Code] .....
View 1 Replies
View Related
Sep 11, 2013
I have a SDI application that uses a CFormView class to create a window and this window has 2 buttons and 2 edit boxes.
I can resize this window, like minimize and maximize, but the controls all stay at the same place.
I know that it's possible to move the controls based on window size.
But what i want to do is, as the window is expanded the controls and it's text content to grow proportionally and same when the window is shrinked.
Is that possible to do? i.e., increase/decrease size of controls and texts per window size.
View 2 Replies
View Related
Apr 19, 2014
I created class called students which suppose to store students names of in array but when I call the display function it display only the first name. but I want it to display names depending on the array size.
#include <iostream>
#include <sstream>
using namespace std;
const int SIZE=5;
[Code]....
View 3 Replies
View Related
Dec 6, 2013
I know this is more simple than I am making it out to be. I have a solar panel hooked up to an 8-Bit ADC and linked into my Microprocessor. I am trying to take the Binary readout from the ADC and convert it to a decimal number to be displayed on the boards LCD display. I am wiring the ADC to PORTA on my Motorola Freescale Board. This is for a final project for my electronic systems class due on Monday...
View 3 Replies
View Related
Dec 10, 2013
I need a large string vector for file content manipulation.
v1.max_size() gives me 153 391 689.
But if I make a test by looping a vector pushing back strings it crashes around 16 - 26 000 000 though I still have a lot of ram (1GB left).
How come and why isn't vector size limited by ram instead?
View 11 Replies
View Related
Apr 12, 2013
I am trying to generate a couple of vectors, but the exact number of vectors that will be needed can only be determined at runtime. Therefore I had the idea to use a macro call and text substitution in order to declare the necessary number of vectors. Unfortunately, the arguments of a macro call are always (as far as I know) considered text only. So, the loop in my example below in which I am trying to generate the following code:
vector<int> vector0;
vector<int> vector1;
vector<int> vector2;
vector<int> vector3;
does not work.
#include <iostream>
#include <vector>
using namespace std;
#define declareVec(vecno) vector<int> vector##vecno;
[Code]......
I get an an error message 'vector0' was not declared in this scope.
I also tried to initialize a string or char with the content "0" and then pass this string or char to the macro call, but this did not work either.
Is there any way in which I could use the content of an integer variable or any other variable as arguments for a macro call?
View 1 Replies
View Related