I'm looking for a way (on a pocketPC) to interrogate the size/remaining size of an SD card.
I have to create some files on the SD card and I want to make sure there's enough room before I write to it.
...
Hi,
I only know that the difference between hashmap and map is that hashmap is implemented with hash function but map is implemented with tree. Could any body add anything more?
Based on this, is there any thing hashmap can do but map cannot?
...
Note, my question is not: how do I tell my compiler to compile with profiling on.
I want to profile my compiles process. For each file, I'd like to know how much time is spent on each line of the program.
I'm working on a project, some files have huge compile times, I'm trying to figure out why.
Is there anyway to do this with g++ or ...
I've always wondered this, and still haven't found the answer. Whenever we use "cout" or "printf" how exactly is that printed on the screen?. How does the text come out as it does...(probably quite a vague question here, ill work with whatever you give me.). So basically how are those functions made?..is it assembly?, if so where does th...
I couldn't find a download-to-print version of the Apache C++ Standard Library User Guide anywhere - the only options available are the frames and no-frames versions online. Writing a script to wget and collate them seems overkill.
Does anyone know if a downloadable-to-print PDF or other formats exist - and if not, why not?
PS - I rea...
Hi guys.
What is the issue with this code?
Here we have two files: classA.h and classB.h
classA.h:
#ifndef _class_a_h_
#define _class_a_h_
#include "classB.h"
class B; //????
class A
{
public:
A() {
ptr_b = new B(); //????
}
virtual ~A() {
if(ptr_b) delete ptr_b; //????
num_a = 0;
...
I'm looking at a member function
int funct(int x) const;
And I'm wondering if
static int funct(int x);
would be better.
If a member function doesn't use any of the member variables should it be static. Are there any things that would discourage this?
...
Hi,
I need to learn C++ in order to learn building Nokia WRT and or maemo application.
I need to know what gotchas and what aspect of C++ that I need/have to learn or focus more.
One thing I got in my mind is that C++ doesn't have garbage collector. Therefor, I need to focus on variable type. But, is there any others that really importa...
When trying to inline a function in Visual C++ (2008 express), I got a linking error, after a close inspection of the code, what I discovered is that the function I am trying to inline throws an exception... if I remove the exception throwing, the linking error goes away, can someone explain why it is the case?
int com_ximpleware::FastI...
Hi,
I have a class A which takes a reference of B in its constructor.
class A {
public:
A(B& b);
}
And I have a class SubB which is a child class of B:
class SubB : public B {
//omitted...
}
In my code, I create a SubB and pass it to A:
SubB subB;
A a(subB);
But I get this compile Error:
error: ‘B’ is ...
Hi I got some binary files containing integers.
Is there some nice unix command, that will allow me to dump it to a terminal without offset info etc?
something like
double int[4];
while(fread(tmp,sizeof(int),4,stdin))
for(int i=0;i<4;i++) printf("%d\t",tmp[i]);
It seems that hexdump and od gives me the information I want, but t...
I want to use the PCH file to speed up the build, so i store the PCH file in a separate folder and reuse it when build the project later.
but I have some #import *.dll in my stdafx.h. so if something changed in the *.dll, the PCH file need be recreated.
my question is whether I can use multiple PCH files in 1 project, so that i can put...
So given x, and power, n, solve for X^n.
There's the easy way that's O(n)...
I can get it down to O(n/2), by doing
numSquares = n/2;
numOnes = n%2;
return (numSquares * x * x + numOnes * x);
Now there's a O(log(n)) solution, does anyone know how to do it? It can be done recursively.
...
Hello,
I would like to utilize the UnitTest++ library in a testing file. However, I am having some difficulty getting the library to be included at compile time. So here is my current directory structure:
tests/
UnitTests++/
libUnitTest++.a
src/
UnitTests++.h
unit/
test.cpp
I have just used the UnitTest++ gettin...
For example, how to get the version of /usr/lib/libz.a? It will be great if other useful information such as compiler/arch etc. can be fetched.
The reason I want to know this is that gcc always say it ignored the libz I offered in command line when I compile my program and linked with specific versioned libz. gcc think the /usr/lib/libz...
I'm trying to return a string from a function. Which basically adds some chars together and return the string representation.
string toString() {
char c1, c2, c3;
// some code here
return c1 + c2; // Error: invalid conversion from `char' to `const char*'
}
it is possible to return boolean values like return c1 == 'x'. Isn't i...
Hi All,
I am developing Firefox extension in C++
I want to get the tab index of the tab window for which I have got STATE_STOP for STATE_IS_NETWORK.
i.e. I want to find the tab index associated with the request.
How do i get it?
Please help me !!!
Thanks in advance,
Vaibhav.
...
Here is my code:
#include <iostream>
#include <stdlib.h>
#include <fstream>
using namespace std;
int main() {
string line;
ifstream inputFile;
inputFile.open("input.txt");
do {
getline(inputFile, line);
cout << line << endl;
} while (line != "0");
return 0;
}
input.txt content:
5 9 2 9 3
8 ...
I want to scan FAT32 disk (I just need file path and file name) as soon as possible in C++,
Scan every files on FAT32 disk.
Is there any API to do this? Many thanks!
...
Hi there, just want to ask a beginner question...
here, I made some code, for understanding the concept/basic of pointer:
int a=1;
int *b=&a;
int **c = &b;
int ***d = &c;
cout << &*(&*d) << endl;
can someone explain to me, why the &*(&*d) return address of "c" instead of address of "b"?
I've also tried code like &*(&*(&*(&*(&*d)))),...