Hi,
I have a function that I would like to apply to each pixel in a YUN image (call it src). I would like the output to be saved to a separate image, call it (dst).
I know I can achieve this through pointer arithmetic and accessing the underlying matrix of the image. I was wondering if there was a easier way, say a predefined "map" fu...
I am having problems with the code bellow.
It can write fine if i kill the read section.
It can read fine if i kill the write section and the file has already been written.
The 2 don't like each other. It is like the write stream is not closed... though it should be.
What is wrong?
#include "stdafx.h"
#include <iostream>
#include <...
I am doing some validation of the arguments passed by command line in C++ and am having some difficulties.
I am doing like so
./a.exe inputfile.txt outputfile.txt 16 flush_left
And I am trying to do the validation like so
if(argv[4] == "flush_left" || argv[4] == "flush_justify" || argv[4] == "flush_right"){
And its not working out...
So, I'm trying to figure out the total amount of return from an investment of £5 with a daily interest rate of 1.01%. Obviously, I am wanting the compound interest rate, so I have this so far:
int main() {
double i = 500;
int loop;
int loopa;
double lowInterest;
double highInterest;
lowInterest = 1.01;
high...
Say you have some target class with some methods on it:
class Subject
{
public:
void voidReturn() { std::cout<<__FUNCTION__<<std::endl; }
int intReturn() { std::cout<<__FUNCTION__<<std::endl; return 137; }
};
And a Value class (similar in concept to Boost.Any):
struct Value
{
Value() {}
Value( Value const & orig ) {}
temp...
(SOLVED: See self-reply. Thanks to those that answered).
I'm having a weird problem with a C++ DLL I am loading dynamically into my Delphi 6 Pro program. One of the function calls in the DLL is:
__declspec(dllexport) int foo(unsigned int A, unsigned long bitsetVector);
I have the function pointer cast in my Delphi function as:
foo ...
There are several good cross-platform libraries, by which we usually mean something that wraps the commonalities of Windows and *nix. Is there anything for developers that don't really care about Windows but want the benefits of C++ wrapping *nix system calls?
I am thinking of a library that reduces the tedium of struct setup, checking...
Hi,
I am new to C++, and I'm having trouble segmenting my code. Here is my setup:
A main.cpp that calls function that takes 2 int and 1 char* and returns int
A function.h that contains, among other things, a function prototpye
int function(int a, int b, char* c);
A function.cpp that contains the actual function definition.
I have...
$12.8/2 - 'A non-template constructor
for class X is a copy constructor if
its first parameter is of type X&,
const X&, volatile X& or const
volatile X&, and either there are no
other parameters or else all other
parameters have default arguments
(8.3.6).106)'
So far, I have not come across any example of a situation w...
Greetings,
I'm just looking for a bit of help here. Here's the prompt:
For research purposes the admissions officers of your local university wants to know how well female and male students perform in certain courses. The user enters the number of courses to be considered. The student's data for each course is provided as a GPA followe...
can anyone help me to find out the top 1% (or say top 100 pixels)brightest pixels with their locations of a gray image in opencv. because cvMinMaxLoc() gives only brightest pixel location.
Any help is greatly appreciated.
...
Hi,
Can any body convert this code to C++
string[] strarr = {"ram","mohan","sita"};
foreach(string str in strarr) {
listbox.items.add(str);
}
Thanks in advance.
...
void aFunction_2()
{
char* c = new char[10];
c = "abcefgh";
}
Questions:
Will the: c = "abdefgh" be stored in the new char[10]?
If the c = "abcdefgh" is another memory area should I dealloc it?
If I wanted to save info into the char[10] would I use a function like strcpy to put the info into the char[10]?
...
Is it possible to get the object name too?
#include<cstdio>
class one {
public:
int no_of_students;
one() { no_of_students = 0; }
void new_admission() { no_of_students++; }
};
int main() {
one A;
for(int i = 0; i < 99; i++) {
A.new_admission();
}
cout<<"class"<<[classname]<<" "<<[objectname]<<"has "...
I am using pthread in Linux. I would like to increase the thread priority by setting the parameters sched_param.priority. However, I could not find much info from the net regarding the range of the thread priority I could set, or about the description of the thread priority.
Also, I would like to know about the relative thread priority ...
Hi,
I'm trying to develop an ebook reader(for mobile devices) which is platform independent. Currently my focus is epub only.
As a proof of concept, we were able to make a basic epub reader for android platform, using the functionalities provided by the platform itself(using webview, Xml Parser, Unzipper etc). But now we want to make i...
With this code (just a class of test):
typedef unsigned short UInt16;
template<class T>
class CClass
{
public:
SValue* getNewSValue(void);
private:
typedef struct {
T *mValue;
T *next;
T *previous;
UInt16 index;
} SValue;
};
template<typename T>
SValue* CClass<T>::getNewSValue(void)
{
re...
How would I draw outside the client area of a window, and on the title bar. I know it can be done, but I am unsure of how to implement this effectively. Think google chrome, where the tabs are on the title bar.
...
Does boost provide any classes to implement a tridiagonal matrix?
...
I have two classes. One is the Part class, its purpose is to deal with visual requirements. The other is the Whole class, its purpose is to deal with operational requirements.
Of course Whole class has Part class data members. I want to manage Part class operational requirements with Whole class and Whole class visual requirements with P...