Forum

Posts

RECENTLY INDEXED PROGRAMMING SOLUTIONS OF C Language


Integer conversion rank implementation-defined  

The most recent draft N2315 says in [conv.rank]/p.1: "The rank of any extended signed integer type relative to another extended signed integer type with the same size is implementation-defined, but still subject to the other rules for determining the integer ... Continue Reading
Views : 63
Monday 26th of November 2012

="">What is this operator ">="  

Shuzhen wrote: $PHXGREAT I saw something like the following in C++ code. Could anyone tell me $PHXGREAT what it means? $PHXGREAT $PHXGREAT a $PHXGREAT?= b; I think it's a non-standard GCC extension. Uli... ="">Continue Reading
Views : 72
Monday 26th of November 2012

Downcast with smart pointers  

Hello, I'm having a design issue that I can't solve. I'm getting from a network a stream of data, which is a http message (my program is neither a client or server, it just catches messages over the network) For ... Continue Reading
Views : 71
Monday 26th of November 2012

STL Iterators  

Hello, I have a collection of objects and I want to iterate over the collection but I only want to hit elements that match some condition. For example, let's say my object has 3 integer data members: A, B, and ... Continue Reading
Views : 83
Monday 26th of November 2012

Methods for fast binary file output  

Hello, I am a C/C++ newbie and I have a simple question concerning fast data writing to binary files. Are there any other faster methods than the standard write() method to write to binary data files? I ask this question ... Continue Reading
Views : 74
Monday 26th of November 2012

Handling daylight savings with standard time functions  

Hi, Is there any way to make time-of-day adjustments for daylight savings using only standard time functions? We have a program that executes daily at a fixed time of day. After daylight savings happens, the time-of-day alignment is lost. For ... Continue Reading
Views : 96
Monday 26th of November 2012

problem debugging: stack frame corruption.  

I am debugging a program, and just before calling a function I have correct values for some local variables, and just entering the called function, the values get corrupted. Like this: gdb) up #1 0x08050140 in neig_particle$PHXLESSfloat$PHXGREAT::getAreasVolume (this=0x80616c8,... Continue Reading
Views : 168
Monday 26th of November 2012

open letter to comp.lang.c++.moderated readers  

-----BEGIN PGP SIGNED MESSAGE----- gardens in search of marijuana plants. The DEA has * subpoenaed Florida garden centers to turn over records showing who * has bought items like fluorescent lamps and plant food. [What???] * CBS News, Dan Rather ... Continue Reading
Views : 67
Monday 26th of November 2012

What is the 'explicit' mean as a key word  

Hi all ! What is the 'explicit' mean as a key word? Thank you!... Continue Reading
Views : 91
Monday 26th of November 2012

Creating array of data types  

Hi All, I would like you help me in creating an array of data types. I am interested in look at the the data type which looks like this Array a[10]={int,float,char,int*..............................}, so that a[0] should return me int and a[1] ... Continue Reading
Views : 109
Monday 26th of November 2012

c struct with pointers assignment  

Hello, I have a struct with pointers. I am trying to assign and instance of the struct but keep getting a seg fault. I am new to c, so I am uncertain of how to handle this. Any help is ... Continue Reading
Views : 68
Monday 26th of November 2012

compile time errors due to changes in stl_list.h code  

I am trying to get rid of compile time error that I am getting only in RHEL5 (not in RHEL4) apparently due to the changes in the stl_list.h file. The error that I am getting is coming from the following ... Continue Reading
Views : 483
Monday 26th of November 2012

new & delete  

Could someone with access to the standard please tell me what it says (if anything) about new initialising the allocated memory to zero, and/ or delete setting the pointer to NULL? Thx.... Continue Reading
Views : 147
Monday 26th of November 2012

Basic question on streams  

I understand that to creat a file output stream for example, I have to include $PHXLESSfstream$PHXGREAT and then: ofstream fout; which will create an object of type ofstream that I can use to interact with a file. My question concerns ... Continue Reading
Views : 121
Monday 26th of November 2012

About the retrogression problem when passing a array variable into a function which takes a pointer as its argument.  

Hi, folks, As the Subject suggests, array variable will retrogress as the parameter of the function actually taking pointer as its argument, like this: int f(int* i) { cout $PHXLESS$PHXLESS sizeof(i) $PHXLESS$PHXLESS endl; return 0; } main() { int a[100]; ... Continue Reading
Views : 165
Monday 26th of November 2012

how to use the return value when using C# dlls in a C++ project  

hi, I am using a C# library in my C++ project. I want to make use of the classes defined in the library to do some job, and use the return value to go on other works in my project. ... Continue Reading
Views : 249
Monday 26th of November 2012

forcing new to fail (or throw an exception)  

Hello, Here is a little question. I was reading up on the FAQ on pointers: http://www.parashift.com/c++-faq-lit....html#faq-16.6 and wanted to see what g++ (ver. 4.1.3) does if it cannot allocate enough memory by trying to allocating huge amount. Here is what ... Continue Reading
Views : 174
Monday 26th of November 2012

Template static member initialization  

Hi! My template class has a const static data member, which is used by the constructor. It seems that the program does not produce the correct result. Either it is the fault of the compiler (gcc 4.1) or I need ... Continue Reading
Views : 83
Monday 26th of November 2012

how does map take care invalid range for erase()  

Does standard say anything about this situation? or it is an undefined behavior? Thanks ------------------------------ map$PHXLESSint, int$PHXGREAT test; test[1] = 1; test[2] = 2; test[3] = 3; test.erase(test.find(1), test.find(2)); // basically this is an invalid range to erase. ... Continue Reading
Views : 145
Monday 26th of November 2012

linked links - have to use structs  

Hello, I am very much still learning to use pointers and am now using them to implement some basic ADTs including linkedlists. I realize C++ standard includes a ton of goodies including a linkedlist template. I am attempting to implement ... Continue Reading
Views : 154
Monday 26th of November 2012

Writing portable code  

Hi, I'm interested in writing portable C++ with a view to it remaining portable for $PHXGREAT5-10 years, when there may be a new standard or even a new standard + TC. On reading the RM(C++03) it seems that items in ... Continue Reading
Views : 91
Monday 26th of November 2012

How to get some C++ proficiency  

Hi folks, I have been developing a bit with C++ earlier here and then, mostly at technical college and also for my bachelor's thesis. But I can't claim to have any professional experience, always took on Smalltalk and now Java ... Continue Reading
Views : 52
Monday 26th of November 2012

atexit problems and questions....  

Hi all, This question relates to an earlier thread I started (static object as member of a class). I have the following (illustrative) code. Again, I hope to make no typos: class A { ... //whatever here }; class B ... Continue Reading
Views : 187
Monday 26th of November 2012

How to Checking a URL :Valid or Invalid  

Hi All, Could any body help me. Regarding how to check a URL is Valid or Invalid. I am using Four functions to check the same. 1) hConnect = WinHttpConnect( hSession, "www.google.co.in", INTERNET_DEFAULT_HTTPS_PORT, 0); 2) hRequest = WinHttpOpenRequest( hConnect, "{GET}",... Continue Reading
Views : 45
Monday 26th of November 2012

overloading << for map and multimap simultaneously  

I overloaded operator $PHXLESS$PHXLESS for STL map successfully: template $PHXLESStypename T1, typename T2$PHXGREAT ostream & operator $PHXLESS$PHXLESS (ostream & o, map $PHXLESST1,T2$PHXGREAT & m) { //code } the code works like a charm. Now, I want the same functionality for ... Continue Reading
Views : 84
Monday 26th of November 2012

Remote control of other BCB Exe-File  

Hi. I need to make a remote control from a different Borland c++ Exe file. Sending a keypress to the program is easy. Sending a mouseclick to the program (choose a tabcontrol or emulate a buttonclick) should be easy...(i hope.....) ... Continue Reading
Views : 71
Monday 26th of November 2012

Looking for macro replacements  

Hi all, I've a pair of nasty macros more or less in the style of boost/foreach. I'm curious to know if: a) They cause undefined behavior. b) They are non-portable. c) There's any way to simplify them (while keeping the ... Continue Reading
Views : 135
Monday 26th of November 2012

Order of destructor execution.  

Sorry if this may seem to be very obvious, but it is important and I decided to ask. I have the following classes: class MutexWrapper { public: MutexWrapper( void ); void lock( void ); //Maybe const, whatever. void unlock( void ... Continue Reading
Views : 98
Monday 26th of November 2012

=utf-8B4peY4peYIFdhdGNoIEZSRUUgU2F0ZWxsaXRlIFRWIG9uIHlvdXIgUEMg4peY4peY=  

Turn your Computer into a Ultimate TV ??? Watch all your favorite shows on your Computer & TV! ??? Channels you can???t get any other place in the U.S.A! ??? Watch from anywhere in the world! ??? Save 1000's of ... Continue Reading
Views : 66
Monday 26th of November 2012

Design Pattern Question: Why use Interfaces  

I am refactoring code. The original authors of my project performed a lot of cutting and pasting making it hell to maintain (because you have to fix the same bug in 16 different places) and it is my job to ... Continue Reading
Views : 132
Monday 26th of November 2012