Given a C++/UNIX library file (without extension), i need to determine the type of library whether it is a dynamic library (.so file) or a static library (.a file) based on its content (say grepping the content against a keyword)
How do i do it in UNIX command line ?
...
EDIT: Is it possible to NOT use new? (do not dynamically allocating memory)
I think it is push that is wrong, but I don't know where, how, and why. here is the code:
struct Node {
string fileName;
Node *link;
};
int size(Node *&flist) {
int count = 0;
Node *tempPtr = flist;
while (tempPtr != 0) {
count += 1;
...
Is there a Java equivalent of the C / C++ function called frexp? If you aren't familiar, frexp is defined by Wikipedia to "break floating-point number down into mantissa and exponent."
I am looking for an implementation with both speed and accuracy but I would rather have the accuracy if I could only choose one.
This is the code sampl...
What is the initial heap size alloted typically to a C++ program running on UNIX based OS ?
How is it decided by the g++ compiler if at all it has a role to play in this regard ?
...
Hi,
i have a file, 'date.txt' which has date in it. Like,
Mon Oct 13 09:37:08 2009.
Now i want to compare this date with system date. How can i compare dates in C++.?
I used this code to get the contents from the file 'date.txt'
string date;
while ( inDateFile >>date) //inDateFile is an ifstream object
cout<<date<<...
IP_ADAPTER_INFO *ptr=new IP_ADAPTER_INFO[100];
if i free using
delete ptr;
will it lead to memory leak, if not then why ?
This is disassembly code generated by VS2005
**delete ptr;**
0041351D mov eax,dword ptr [ptr]
00413520 mov dword ptr [ebp-0ECh],eax
00413526 mov ecx,dword ptr [ebp-0ECh]
0041352C ...
When I use LD_PRELOAD=/usr/local/lib/libtcmalloc.so, all my calls to malloc become tcmalloc calls. However, when I link statically against libtcmalloc, I find that straight malloc is getting called unless I still use the LD_PRELOAD setting.
So how can I statically compile against tcmalloc in such a way that my mallocs hook into tcmallo...
I am working on a translation application in which users are allowed to give English input and I need to convert to a target language and display on a text box. I am facing problems in displaying unicode characters.
Complex characters are not rendering correctly. I know windows uses Uniscribe for rendering complex characters. So do I ne...
Possible Duplicate:
How to programmatically get DLL dependencies
On Windows, in a C++ program, I want to know if a given DLL (I know the path) is loaded by a given external process (I know the path of the exe), using win32 functions.
It must be possible to list all DLLs loaded by a process, as process explorer does.
Fabien
...
Hi,
I want to read status information that an application provides via shared memory. I want to use C++ in order to read the content of that named shared memory and then call it with pinvoke from a C#-class.
From the software I know that it has a certain file structure: A struct STATUS_DATA with an array of four structs of SYSTEM_CHARA...
Hi folks!
I can't understand, why if we define static variable of usual (non-template) class in header, we have linker error, but in case of templates all works fine and moreover we will have single instance of static variable among all translation units:
It's template header (template.h):
// template.h
template<typename T>
class Templ...
How to write logs to files of size 64KB(to allow notepad to read).Once the file has reached 64KB it should go head and create another , another ......
File names can be automatically generated.
I tried the following code
static int iCounter=1;
CString temp;
static CStdioFile f(L"c:\\Log1.txt", CFile::modeWrite | CFile::modeRead |...
Possible duplicates
What is gcnew?
What does the caret mean in C++/CLI?
Difference between managed c++ and c++
I am a advanced C++ programmer with g++. But currently I am working on Visual C++ 2005 doing Windows Forms Application programming . But I am finding it hard with its new terminology. For e.g. instead of new it has gc...
I've written a console program that "does stuff" - mainly using boost. How do I convert it to a Windows Service?
What should I know about Windows Services beforehand ?
Cheers!
...
What's an easiest reliable way to retrieve the fully qualified domain name of the current host in Win32?
I've tried calling gethostname(), but it returns a NetBIOS name.
...
I'm trying to write a small test using QHttp to get an URL and return its content.
The program ran fine, but it has some problem.
With this link http://www.mediafire.com/download.php?ztyniqhd4lb ( or some random MF link ), my program cannot load all its content.
With some workaround, I found that all the SIGNAL before the done(bool) ...
I have inherited a bunch of networking code that defined numerous packet types. I have to write a bunch of conversion functions that take structs of a certain type, and copy the values into other structs that have the same fields, but in a different order (as part of a convoluted partial platform bit order conversion thing -- don't ask)...
How to get hardware id of the usb device using device id...i am using vc++6.0 and OS is xp.
is it possible by using wmi.
...
I want to create an environment class that is accessible from all of my classes in my program but I dont want to initialize the environment object everytime I want to access its members from my other classes. What is the best way to go around doing this in C++?
I want to do this because I have the environment object store all my config ...
Hi!
I'm using Dev-C++ under Windows. My question is how can i start a process on a remote machine? I know that PsExec can do that, but if it's possible, i want to avoid to use it.
If someone can give some example code, i would appreciate it :)
Thanks in advance!
kampi
...