I am writing a Linux CLI program. I need to get a password from the user and, obviously, I don't want the password to be echoed to the console.
There are several solutions available here, but they are all for plain C.
http://stackoverflow.com/questions/1786532/c-command-line-password-input
http://stackoverflow.com/questions/1754004/ho...
In my life I have learned many program languages: C, C++, python, java, assembly, javascript, php, etc but some times I don't know what languages is better for some projects.
So I want to know, in your opinion:
what situation is python better in ? and Why ?
what situation is c++ better in ? and Why ?
what situation is php better in ?...
Before reading the question:
This question is not about how useful it is to use dynamic_cast. Its just about its performance.
I've recently developed a design where dynamic_cast is used a lot.
When discussing it with co-workers almost everyone says that dynamic_cast shouldn't be used because of its bad performance (these are co-workers ...
how to use html templates in C++ to convert html file to ps in C++
...
In some code I'm writing, I have the following line, which gives me error C2064:
rs_opCodes[cur_block]();
rs_opCodes is defined as such:
typedef void (rsInterpreter::*rs_opCode)();
rs_opCode rs_opCodes[NUM_OPCODES];
Does anyone know why I'm recieved error C2064?
...
I have a class which I can write like this:
class FileNameLoader
{
public:
virtual bool LoadFileNames(PluginLoader&) = 0;
virtual ~FileNameLoader(){}
};
Or this:
class FileNameLoader
{
public:
virtual bool LoadFileNames(PluginLoader&, Logger&) = 0;
virtual ~FileNameLoader(){}
};
The fir...
Can someone please help me. I understand the equation of a line and how to solve for the zero intercept on paper, but I have trouble converting it to code. More specifically, I need to calculate the point at which a line intercepts any given X or Y coordinate with two different functions...
double CalcLineYIntercept(LINE *line, double y...
If I write a random string to file in C++ consisting of some unicode characters, I am told by my text editor that I have not created a valid UTF-8 file.
// Code example
const std::string charset = "abcdefgàèíüŷÀ";
file << random_string(charset); // using std::fstream
What can I do to solve this? Do I have to do lots of additional manu...
Hello Experts,
I am trying to create an avi file for a given jpg images. I am reading jpg's using a library and preparing hbitmap for it. Finally i am adding it to create avi file. But my final avi file contains the inverted images. I kept nagative for hight in bitmapheader. Still my hbitmap is inverted. Can you please help why the erro...
Hi all!
I have to implement a kind of FTP server in C++ for a school project. The goal is learn how the FTP works internally.
I'm a lil bit lost in how to start it. I know the FTP Protocol, but I still don't know what can I do to start coding.
Someone can point me a way to start? Some links, libs in C++, etc?
Remembering that is a serv...
Hi all!
I would like to ask you for an advice about function template. I have a function that adds some data into buffer. But I need also to add an information about data type into the buffer. The type of data is a following enum:
enum ParameterType
{
UINT,
FLOAT,
DOUBLE
};
And I need to create a function template from funct...
This is my first time using JNI. I need to call a third-party Visual C++ library from a Java program, so I wrote a wrapper in Visual C++. The library loads fine, but when I try to call a function from my wrapper library, I get the dreaded UnsatisfiedLinkError.
My wrapper includes the .h file created by javah, and has the following in ...
I have an application thats a mix of c++ and objective-c.
Quite a lot of the c++ classes exist merely as facades to access the underlying objective-c object from the rest of the x++ application.
My problem is one of design: The objective-c class needs to call back into the c++ class via a set of methods I'd prefer to mark as private - ...
On 64 bit host I am trying to build shared libraries with -m32 option. Is it possible for these libraries to be linked with regular 64 bit libraries?
I am doing something like this:
g++ -m32 -shared source.cpp -l 64_bit_library.so -o 32_bit_library.so
and getting error messages like this:
/usr/bin/ld: skipping incompatible 64_bit_li...
Earlier I managed to port some C++ CryptoPP Rijndael_128 CBC code to MCrypt PHP, but now I'm having problems with CFB mode. The C++ and PHP results do not match (well the first byte matches but this could be coincidence, everything else doesn't). With some diagnostics, it looks like PHP's mcrypt is not setting the key length correctly?
...
I want to perform a comparison of multiple implementations of basically the same algorithm, written in Java, C++ and Python, the latter executed using Pypy, Jython and CPython on a Mac OS X 10.6.4 Macbook Pro with normal (non-SSD) HDD.
It's a "decode a stream of data from a file" type of algorithm, where the relevant measurement is tota...
I'm writing a basic scripting system using lua in C++. One of my glue functions is...
lua_register(luaVM, "openFile", l_dial.l_specifyF);
The function is as follows.
static int l_specifyF(lua_State* luaVM) {
const char* c = lua_tostring(luaVM, -1);
cDialogManager::getSingletonPtr()->clearVector();
try{
luaL_dofile...
Hello
In C++ you can do the following:
int x = 5
cout << x;
// prints 5
int* px = &x;
(*px)++;
cout <<x;
// prints 6
Is there an equivalent construct in Java
...
I have a complex struct i want to put as a key of the std::map to make a list of all unique objects fast:
union somecomplexstruct {
struct {
more_structs val1, val2;
even_more_structs val3, val4;
lots_of_more_structs val5;
};
unsigned int DATA[3];
};
typedef map<somecomplexstruct, int, greater<som...
I have OpenCV 2.1 and Qt (Creator) installed on Windows.
Using the OpenCV C API I can link, build and run apps in Qt using OpenCV.
However, the when using the OpenCV C++ API, I am getting linking problems.
This is probably due to C++ ABI problems, since I'm using the pre-built binaries (built with MSVC-2008) for Windows and Qt Creator us...