C++ :: Debug Function For Application - Output Values List
Jul 11, 2012
I'm trying to write a debug functions for my application so I can see all the values I like to. My goal is it looks like this:
Code:
void Debug(std::message, ...)
So that I can call it like this:
Code:
Debug("Error: %i, %i", 34, 35);
How I can work with %i, or if there are better solutions. This is what I've so far (not much), just a basic idea:
Code:
void Debug( std::string message, ...) {
va_list list;
va_start(list, message);
??? va_arg(list, ?? );
va_end(list);
// here message should contain everything and be ready for output ?
cout << message << endl;
}
View 3 Replies
ADVERTISEMENT
Mar 3, 2013
How can we debug the multithreaded application in unix environment?
View 1 Replies
View Related
Dec 31, 2013
I dumped all symbols into C:WindowsSymbols folder, It takes more than 2 minutes to load an application which really surprises me. Why and when should I use those symbols?
View 1 Replies
View Related
Jul 12, 2014
I'm having some trouble working out how to read the console output in realtime, here's my code:
The button which starts the console application:
private void HELPRUN_Click(object sender, EventArgs e)
{
this.Output.Text = "";
[Code]....
View 6 Replies
View Related
Nov 11, 2014
I have an application that reads a process and return values from it. The problem it works fine with small processes but i have some processes that are about 1GB or even 2GB and when i try to read such big processes the application crashes. I'm trying to find a way to read the process memory in chunks of maximum 10 MB. The read code looks like:
Code:
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, entry.th32ProcessID);
unsigned char *p = NULL;
MEMORY_BASIC_INFORMATION info;
for (p = NULL; VirtualQueryEx(hProcess, p, &info, sizeof(info)) == sizeof(info); p += info.RegionSize)
[Code] ....
This reads the info.regionsize which can be as large as 100 MB. Is there any way to read it in chunks ?
View 12 Replies
View Related
Aug 31, 2014
I am trying to write a program that will take a list of integers from a file and write them to another text file. I've been banging my head at this for days trying to get it to compile as it is riddled with linker and compiler errors.
**************************header*************************
#ifndef LINKEDLIST_H
#define LINKEDLIST_H
#include <iostream>
using namespace std;
template <class T>
class linkedList {
[Code] ....
View 6 Replies
View Related
Dec 19, 2012
Basically the question is to develop an application that allows: Create an application which stores information about people, along with a task list.
The user should be able to Store people's information
Name,
Age,
Telephone number,
Address
-Retrieve information by entering name
- Remove a person's record by entering their name
-Return records for all people, sorted according to an information type other than age
-Enter a task which needs doing, a priority entered for its urgency
-View highest priority task on the list
-User should be able to remove highest priority item on the list
How to develop this application on a console command line interface style or any other style.
View 2 Replies
View Related
Jan 23, 2014
so i got this piece of code today having some slight errors with it, how its actually done as i want to know where i have gone wrong here is the code .. Using a for loop to input and output array values
*/
#include <stdio.h>
int main(void) {
/* Declare an array of integers */
int Grades[5];
int nCount;
/* Populate the array */
for(nCount = 0; nCount < 5; nCount++)
[Code]...
View 3 Replies
View Related
May 21, 2012
I'm wanting to create an image, all I need is to be able to set RGB values and X-Y coordinates, I'm not wanting to read or manipulate images. Any easy to use library or another simple method of doing this?
View 1 Replies
View Related
Mar 25, 2014
This is one part of my program, I need a loop that checks through the input(specifically the agent numbers) and then outputs the agent numbers that aren't in the input, from 1 to 20(because there should only be 20 agent).
My input is :
1 3 250.00
2 0 0
15 1 1000.00
3 4 300.00
12 2 500.00
1 2 300.00
3 4 115.00
21 3 400.00
-1 4 250.00
15 1 200.00
9 5 -150.00
18 2 140.00
13 2 550.00
the first numbers are the agent numbers so 1 , 2 ,15 are agent numbers and out output for agents who didnt participate are : 2 , 5 , 6 , 7, 8, 9, 10 , 11 , 14 , 16 , 17 ,19 20
this is the code ive wrote but its not working.
void not_part() {
ins.open(in_file);
int i=0;
int sum=0;
cout<<"AGENTS WHO DID NOT PARTICIPATE IN THE CAMPAIGN"<<endl;
cout<<fixed<<showpoint;
[code].....
View 1 Replies
View Related
Mar 24, 2014
This is one part of my program, I need a loop that checks through the input(specifically the agent numbers) and then outputs the agent numbers that aren't in the input, from 1 to 20(because there should only be 20 agent).
My input is :
1 3 250.00
2 0 0
15 1 1000.00
3 4 300.00
12 2 500.00
1 2 300.00
3 4 115.00
21 3 400.00
-1 4 250.00
15 1 200.00
9 5 -150.00
18 2 140.00
13 2 550.00
the first numbers are the agent numbers so 1 , 2 ,15 are agent numbers and out output for agents who didnt participate are : 2 , 5 , 6 , 7, 8, 9, 10 , 11 , 14 , 16 , 17 ,19 20
This is the code:
void not_part() {
ins.open(in_file);
int i=0;
int sum=0;
cout<<"AGENTS WHO DID NOT PARTICIPATE IN THE CAMPAIGN"<<endl;
cout<<fixed<<showpoint;
[Code] ......
View 11 Replies
View Related
Jan 24, 2014
I have this code that im stuck on what i need to do is Extend the code such that when it starts the user is asked to input values to specify each of the three ranges before moving on to accept and tally the main values how do i do that Using a for loop to input and output array values Also calculate the average
*/
#include <stdio.h>
int main(void)
{
/* Declare an array of integers */
int Grades[5];
int nCount;
int nTotal = 0; /* Declare and initialise the value */
float fAverage;
[Code]...
View 1 Replies
View Related
Apr 7, 2013
The code below is suppose to output all the prime numbers between the values of startNum and endNum variables. but its not working correctly instead it display all the numbers between startnum and endNumber including non-prime numbers.
void PrimeFinder::run(){
bool isPrime = false;
for(int i = startNum; i <= endNum; i++) {
for(int j = 2; j < i; j++){
if((i % j) == 0)
[Code] ....
View 6 Replies
View Related
Oct 30, 2013
Were are to implement a method countValue() that counts the number of times an item occurs in a linked list. Remember to use the STL <list>
int countValue(list<int> front ,const int item);
Generate 20 random numbers in the range of 0 to 4, and insert each number in the linked list. Output the list by using a method which you would call writeLinkedList which you would add to the ListP.cpp.
In a loop, call the method countValue() , and display the number of occurrences of each value from 0 to 4 in the list.
Remember that all the above is to be included in the file ListP.ccp
The output should be:
2 3 4 0 1 0 2 4 2 3 3 4 3 3 3 0 0 2 0 2
0 : 5, 1 : 1, 2 : 5, 3 : 6, 4 : 3
but I am getting:
1 2 4 0 4 4 3 3 2 4 0 0 1 2 1 1 0 2 2 1
0 : 4, 1 : 5, 2 : 5, 3 : 2, 4 : 4,
Here is my code:
#include<iostream>
#include<list>
using namespace std;
[Code].....
View 1 Replies
View Related
Jan 26, 2013
i am trying to find the max value from a list of 10 values. here i have stored the double values for prices of items in numVal.There are 10 values in numVal i would like to find the max and min value of these numbers. getPrice(1) returns the ten double values.
for(int i = 0; i < store.size(); i++) {
double numVal = this->store[i].getPrice(1);
}
View 2 Replies
View Related
May 1, 2014
I have a list of integers that i wish to store in some kind of array. However i do not know how many integers are needed to be stored each time i run my program so i therefore cannot define a size for my array.
View 2 Replies
View Related
Sep 11, 2014
Trying to output a .txt file of names emails and phone numbers, but this only outputs the list name: Email.PersonEntry.
private void button1_Click(object sender, EventArgs e) {
DialogResult result;
string fileName;
//Find and Open File
[Code] ....
View 6 Replies
View Related
Mar 30, 2013
I am trying to assign a list of values to a vector:
vector<string> words;
words[] = {"one", "two", "three"};
This does not work. How can I accomplish it?
View 5 Replies
View Related
Feb 15, 2012
I have made this program for linked list, but i have one problem with it. I want to make a function that will delete all same values I inuput in the list.
Example: if user inputs 5 I want to delete all 5 for the list. I have tried doing this with the loop inside regular function that erase single value.
This is function that erases single value:
Code:
void list::Delete (int a) {
node *temp=head;
if (temp==NULL)
return ;
if (temp->getNext()==NULL) {
delete temp;
[code]....
View 3 Replies
View Related
Aug 26, 2014
I have an XML document, formatted as such:
<?xml version="1.0" encoding="UTF-8"?>
<Books>
<Bookmark Name="1984" Folder="C:UsersmillerDownloads1984 (George Orwell) - Audio Book" Time="00:43:58.4080000" Chapter="0" />
</Books>
Each Element named Bookmark has 4 attributes, Name, Folder, Time, and Chapter.
I'd like to be able to just put all of them in ONE type of container, without making multiple lists... Is there any way, using Linq to XML, to maybe add all of these values to a Tuple?
View 14 Replies
View Related
Apr 22, 2014
I have a method that traverses a list to compare a number from the list to user input from elsewhere in the program. I have tried a few different things and I am probably overlooking something simple but my problem is my if statement is executing the else statement every run no matter if the input matches. This function is to return the location in the list that the num matches. -1 if no match, 0, 1, 2, otherwise depending on the number of nodes.
int NumberList::find(int num)
{
int temp = 0, count = 0;
ListNode *nodePtr;
[Code]....
View 2 Replies
View Related
Apr 8, 2015
I am creating a to-do list application and to store the tasks on the list, I am trying to create a linked list. the code for it so far is as follows:
public class Node //Class for nodes which make up a linked list {
//Declaring the data to be stored in each node and next variable to point to the next node
public string title;
public string description;
public string priority;
public string finish;
public string complete;
[Code] ....
The problem with this arises when I try to create a new node from another class like so:
createForm create = new createForm(); //Creates an object reference to createForm
create.ShowDialog(); //Shows the createTask form for creating a new task
//Declares variables and stores the return value of methods in createForm
string _title = create.getTitle;
[Code] ....
The variables _title etc.. all store values from text boxes as string. However, the code creating the object says the the variables cannot be implicitly converted from type 'string' to 'int'. Why this error is happening??
View 3 Replies
View Related
Nov 29, 2014
What happens if I make a server application using tcp protocol and then establish connection with a client application but the server crash and then the client send data. Will the data be lost or the system will continue trying to send it?
View 2 Replies
View Related
Apr 16, 2013
I am currently confused on how to get the highest and lowest number from a list of 7 numbers for a File Output. Lets say i have 165 19 654 816 654 987 324. How would i get the 987 for the highest and the 19 as the lowest? Those numbers are not fixed numbers, i need to be able to input any combination of numbers and still be able to get the highest and lowest numbers from the list of 7 numbers.
View 1 Replies
View Related
Apr 19, 2015
The label "You already picked that" doesn't always appear. Sometimes it does, but only if a duplicate has been entered at least 3 times. I haven't been able to correct this. I am new to programming and array-based lists.
//Objective: randomly generate an integer between 1 and 100, input user guess as to what number it is, and output "correct!" if user guess is the random number, or output "Too high" if the user guess is too high, or output "too low" if the user guess is too low, "you already entered __" if a duplicate is entered and allow the user to keep guessing until they guess the correct number
//libraries
#include <ctime>
#include <cstdlib>
#include <iomanip>
#include <iostream>
using namespace std;
struct Guess {
[Code] ....
View 9 Replies
View Related
Mar 18, 2013
im using a for loop to find the index values of the tied high scores and store them into string list then reference list in the second for loop to output it to screen however it isnt letting me use an array with index i as an index its self.
void printHighest(Student s[], int length){
int index;
string list[10];//you're never going to have more than 10 people with a tieing highscore.
index = findMax(s, length);
[Code] ....
For the time being I simply removed the idea of string list and just put the contents of the second for loop into the if statement above it. However, I am still curious as to if I can reference an index of an array in an index of another array.
View 1 Replies
View Related