473,809 Members | 2,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C / C++ Forum

C / C++ programming language - Get answers to questions about compilers, visual C++, templates, namespaces, classes, data structures, OOP (object-oriented programming), inheritance, data types, exceptions, Standard Template Library (STL) and the C Standard Library.
6
1,425
thread by: Alex Buell | last post Feb 24 '06 by: Alex Buell
#include <vector> #include <algorithm> #include <iostream> using namespace std; template <typename T> class LessThan { private:
2
4,611
thread by: silrandir | last post Feb 24 '06 by: Ian Collins
When calling getenv() globally, the function returns NULL, yet when called from main, returns an appropriate value. #include <stdlib.h> #include <stdio.h> #include <unistd.h> //using namespace std; #define MW_DEBUG "TEST"
8
390
thread by: Mark P | last post Feb 23 '06 by: roberts.noah
I was helping a coworker port some code to a new compiler (HP). He had something along the lines of this: class C { // defined in the global namespace static int foo(); }; namespace { int C::foo() {...} };
6
1,492
thread by: cbull | last post Feb 23 '06 by: cbull
class A { }; class B: public A { void f(); }; typedef void (A::*MPA)(void); MPA mpA;
1
787
thread by: Jim Langston | last post Feb 23 '06 by: Alf P. Steinbach
In my code I have this line: CloseOnOpenNotifier.notifyObservers( dynamic_cast<Argument*>( &OpenArgument( NotifyMsg ) ) ); which I'm getting a warning on in VC++ .net 2003 when I set the warning level to 4. c:\Source\Abyssal\source\Abyssal\CGUIElement.cpp(184) : warning C4238: nonstandard extension used : class rvalue used as lvalue ...
5
2,730
thread by: blop | last post Feb 23 '06 by: Randy Howard
I have made a simple pthread program. In main I create a pthread that has a startroutine as argument which adds two integers. The output is correct so I guess the threas runs this startroutine. But when I try to use gdb on the program it never jumps to the start routine, it just goes through the main function and then returns. I use emacs on...
7
1,714
thread by: Nemo | last post Feb 23 '06 by: Default User
Hello Folks, I need to manipulate a list of char strings as follows, but when I want to delete the pointer created with new at the end, delete operator crashes, any idea? char* list; while(...) { list = new char ; strncpy(list, c_TempFilename, Stringlength);
3
1,266
thread by: orium69 | last post Feb 23 '06 by: Keith Thompson
Hi everyone! I have a doubt, when I free an alloced memory, how does the compiler know how many bytes I have alloced forward the pointer. eg: int *coiso; coiso=(int *)malloc(sizeof(int)*10);
37
1,856
thread by: Richard G. Riley | last post Feb 23 '06 by: Flash Gordon
I am looking for a way to integrate the C library documentation into emacs' C mode. Adding any linux library documentation would be a bonus. e.g hilite word, hotkey to library documentation. thanks for any help. -- Remove evomer to reply
14
1,898
thread by: ritesh.noronha | last post Feb 23 '06 by: Micah Cowan
Hi, I am a beginer programmer, i would like to know the exact difference between long and int. Why do we have two names for the same size of variable. Does the size of long and int change on various architectures.. thanks, carl
13
1,921
thread by: Immanuel Goldstein | last post Feb 23 '06 by: Immanuel Goldstein
Obtained under the Freedom of Information Act by the National Security Archive at George Washington University and posted on the Web today, the 74-page "Information Operations Roadmap" admits that "information intended for foreign audiences, including public diplomacy and PSYOP, increasingly is consumed by our domestic audience and...
1
2,490
thread by: Avner | last post Feb 23 '06 by: Victor Bazarov
Hi, I am developing a C++ application within the Microsoft Development Environment 2003 (Version 1.13088). I need to get a snapshot of the memory allocations by objects. Microsoft provided profiling capabilities in Visual C++ 6 version, but stopped after that. Microsoft offers a CLR Profiler for .NET applications, but what about classic...
23
3,200
thread by: Akhil | last post Feb 23 '06 by: Al Balmer
Since a character constant is an int value represented as a character in single quotes,so it is treated as a 1 byte integer now look at the following snippet. #include<stdio.h> int main(void) { char a='Abbc'; printf("%c",a);
0
1,069
thread by: phrite | last post Feb 23 '06 by: phrite
Hello everyone, I recently designed a website called the DigiTrust that is designed to bridge the gap between technology content and people. My goal is to have any user go to the site, and the content will be completly customized based on the users skills and strengths. VB programmers will find a site that contains VB content, Linux users...
0
993
thread by: phrite | last post Feb 23 '06 by: phrite
Hello everyone, I recently designed a website called the DigiTrust that is designed to bridge the gap between technology content and people. My goal is to have any user go to the site, and the content will be completly customized based on the users skills and strengths. VB programmers will find a site that contains VB content, Linux users...
3
7,562
thread by: wakun | last post Feb 23 '06 by: Dietmar Kuehl
Hi there, I am seeking a fastest way to load a BIG string and parse it as a given format. I have a extern function which return a (char *)string in BIG size. Now, I am going to parse it with a iterator as following char *str = return_a_big_size_str(); istringstream ss(string(str), istringstream::in); istreambuf_iterator<char> bit(ss), eit;...
2
1,675
thread by: leaf | last post Feb 23 '06 by: TB
i have a struct which defines a function call stuct TFunction { int id; // ID of the function to call UINT nparams; // No. of parameters ULONG* params // Parameter data } how can i use a Functor to execute a function as well as passing the
11
24,429
thread by: Steve Edwards | last post Feb 23 '06 by: Mike Wahler
Hi, After making an iterator to a map and stepping through a loop, I want to delete any entries that satisfy a test from an external function. MyMapType::const_iterator iter; for(iter = m->begin(); iter != m->end(); ++iter) { a = iter->first;
5
5,622
thread by: leaf | last post Feb 23 '06 by: Michiel.Salters
consider these functions: void foo() { cout << "foo() called; } void sayhello( std::string& msg ){ msg = "something"; } int add( int x, int y) {
30
3,323
thread by: Steve Edwards | last post Feb 23 '06 by: Alf P. Steinbach
Hi, I'm re-writing some code that had relied on some platform/third-party dependent utility functions, as I want to make it more portable. Is there a standard C/C++/stl routine for changing an stl string to all lowercase? (I know how to do it manually, but in the interests of portability...) Thanks Steve
13
3,795
thread by: darkchild50 | last post Feb 23 '06 by: Kenneth Brody
this is a little off topic but its also in comp.windows.programing and hasent goten a reply and so im posting it here: is it possible to loop through all top level windows using GetWindowEx(), and save all their handles in an array? i have been trying this one for a while but it dosent seem to work i end up in a never ending loop. anyone...
2
1,323
thread by: netnobbi | last post Feb 23 '06 by: Phlip
Hi! I'm using (the first time) GTK2 to build a GUI application under windows. Up to now everything worked fine. But now I have a problem: Im using the function gdk_pixbuf_new_from_file to generate a gdk-pixbuf. The program compiles and runs, but no images are displayed. It simply doesn't work. When I have a look at the delivered GError I...
18
1,670
thread by: David Wade | last post Feb 23 '06 by: Dik T. Winter
Folks, Having spent some considerable effort in sorting out the floating point code in the I370 port pf GCC, I would now like a floating point library to go with it. From what I have seen most implementations use "Computer Approximations" by "P Hart" (hope I got that right) for all the constants. Unfortunately my local library can't get me...
5
4,125
thread by: Martin Jørgensen | last post Feb 23 '06 by: Martin Jørgensen
Hi, Consider this code: --- beginning of code --- #include <iostream> using namespace std; class Child{ public:
4
10,857
thread by: Stian Karlsen | last post Feb 23 '06 by: Stian Karlsen
Hi. I'm getting an error in my program. It doesn't occur each time even if the same things happend in my program each time I run it. There will however be different values used for calculations in the program. The error happends suddenly and at different times. I load quiet alot of data into my program. I'm wondering if there are anyone...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.