473,542 Members | 2,057 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.
0
304
thread by: j | last post Jul 22 '05 by: j
0
248
thread by: pctv06 | last post Jul 22 '05 by: pctv06
0
349
thread by: source | last post Jul 22 '05 by: source
function that would: return the 5th element from the end in a singly linked list of integers, in one pass, and then provide a set of test cases against that function. And please dont think this is my homework. Can anybody simple tell me how this can be done. I am preparing for an interview and wanted to know how to go about implementing...
0
968
thread by: christopher diggins | last post Jul 22 '05 by: christopher diggins
I have written and posted a C++ language extension (HeronFront) which demonstrates how interfaces can significantly outperform designs that use multiple inheritance of abstract base classes. For example the NaiveInt class in the following example in C++ : http://www.heron-language.com/abc-example.html when rewritten using interfaces in...
0
349
thread by: Dave | last post Jul 22 '05 by: Dave
Hi. I am new to theads and I wanted some advice on my client/server program on Linux. I want to create a CD database with this functionality. 1. Multiple client requests for the same CD don't require a trip to the database for the same CD. ie 3 requests for "ZZ Tops" = 1 DB read. By storing it in memory.
0
368
thread by: Gil | last post Jul 22 '05 by: Gil
I am running a C++ process on Solaris that needs to find out how much diskspace is free and used on the system. Is 'system' in stdlib.h the only way to make OS calls from C++? In this case, I will probably be making unix calls like 'df' or 'statvfs' to get the diskspace information and redirecting it to a file, and then opening and...
0
437
thread by: Atip Asvanund | last post Jul 22 '05 by: Atip Asvanund
Dear sirs, I am trying to learn how to use Boehm's garbage collector: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ on a Linux machine. I am a beginner, and I find its documentation inadequate. I have followed all instructions for installation, yet I still have the following questions. 1) The instruction said to include the header file,...
0
274
thread by: Saikrishna | last post Jul 22 '05 by: Saikrishna
Hi friends, I am trying to choose the best possible data structure for the probelm I am going to describe now. I have lets say tens of thousands of numbers in file1 and tens of thousands of numbers in another file2. file1 & file2 contents (only numbers) can be entirely different. Now the program should be able to read the files and give...
0
303
VXL
thread by: Aleks Dubinskiy | last post Jul 22 '05 by: Aleks Dubinskiy
Hi, has anyone ever used VXL? Is it useful? (it seems so) Does it have a good community (I'm not seeing any). Is there a newsgroup for VXL users?
0
1,431
thread by: Jörg Striegnitz | last post Jul 22 '05 by: Jörg Striegnitz
We apologize if you have received this CfP multiple times. -------------------------------------------------------------------- SECOND CALL FOR CONTRIBUTIONS AND PARTICIPATION Workshop on MULTIPARADIGM PROGRAMMING WITH OO LANGUAGES (MPOOL 2004) (June 14 or 15, TBD) at the EUROPEAN CONFERENCE ON OBJECT-ORIENTED PROGRAMMING (ECOOP 2004)
0
1,072
thread by: Adam H. Peterson | last post Jul 22 '05 by: Adam H. Peterson
I have a type T (in a template) which I know (or assume) is a pointer to a pair type. I would like to find out what the type of the second element in the pair is. If T were simply a pair, I could get this by doing something like: typedef typename T::second_type U; But how do I handle when T is a _pointer_to_ a pair type (or actually an...
0
460
thread by: Steven T. Hatton | last post Jul 22 '05 by: Steven T. Hatton
In TC++PL(SE) Stroustrup asserts there is a companion reference called _The Annotated C++ Language Standard_ by Koenig & Stroustrup. It doesn't show up on a google. What gives here? I know there is mention of a problem here: http://www.research.att.com/~bs/bs_faq.html#ARM I guess this is the same work? This seems to mean there is a...
0
279
thread by: Huibuh | last post Jul 22 '05 by: Huibuh
I start hating RETURN!!! list<happy> //#include <list>// is searched via iterator (ptr) so long until the argument "number" of the class "happy" is equal now. The function "findhappy" works fine, finds the right pointer "nownumber" with correct values. Behind "return" the memory address remains correct but the values are wrong (a huge...
0
323
thread by: Juha Kettunen | last post Jul 22 '05 by: Juha Kettunen
Hi I don't know if I am using right words (bit-number), but this is what I mean: You can set a 64 bit number: unsigned long a; Now you can use binary operators to manipulate variable a (for example
0
748
thread by: neo88 | last post Jul 22 '05 by: neo88
Ok, here's the deal. I have a nice class definition and a whole bunch of inline functions to go along with it in the same file. My question is, do I need an implementation file for the class, even though I have an inline for every single function? Or can I just use the class and it's inlines as a header file for programs that actually use the...
0
352
thread by: Asfand Yar Qazi | last post Jul 22 '05 by: Asfand Yar Qazi
Hi, I'm testing the gcc-3.4 branch (built with 'make profilebootstrap' sped up compiles by a massive 10%!) Its got better conformance to the C++ Standard (hence this is not an OT post.) I'm having trouble figuring out what it wants me to do. Here's some code, and the error messages generated. namespace NA
0
343
thread by: ccrabfo | last post Jul 22 '05 by: ccrabfo
Has anyone ever implemented embedding a "virtual host" or "virual machine" environment inside your C/C++ programs so that end-users could write small snippets of customized code, compile it using your custom compiler, and if the compiled byte-code file exists, it gets loaded and ran by the embedded virtual host engine? My thought was to...
0
311
thread by: Michael McKnerney | last post Jul 22 '05 by: Michael McKnerney
Hi, When find(x) is called on an STL map, is the check for equality for the key performed as: for all y in the map, find the case where the following is true: key_compare(x, y)==false && key_compare(y, x)==false Thanks,
0
281
thread by: San | last post Jul 22 '05 by: San
Hi, I wrote two simple constructors (one of them default) to initialize a student object. Student::Student(string name) { student_name = name; student_id = LATEST_ID + 1; student_address(""); student_phone(0);
0
258
thread by: pout | last post Jul 22 '05 by: pout
Guess that it should be "delete p", not "delete p", but not sure since it has only one element( ). Is it right? int* p = new int; ... delete p;
0
294
thread by: c++novice | last post Jul 22 '05 by: c++novice
Any suggestions which stl data structure to use if --i need to lookup names indexed by integer idnumbers assigned contiguously from 0 to 10000. --if the names were indexed by SSN#? does hashtable fit here, indexed from 1 to 10000, but before storing into a hash table, i should order them, and then can perform binary search on it. i guess...
0
298
thread by: Angus Comber | last post Jul 22 '05 by: Angus Comber
Hello I have a base class a bit like this: class CTapiCall { // Constructor public: CTapiCall(); virtual ~CTapiCall();
0
1,807
thread by: Jason | last post Jul 22 '05 by: Jason
Dear All, I originally have a look up table of size UInt8. However, there is a restriction that just 1D look up table of size UInt8 can be use. The no. of UInt8 tables to be used is not limited. Are there any simple method for me to constructing many 1D look up tables of UInt8 so that the same result can be obtained as if the
0
1,174
thread by: Georg D. | last post Jul 22 '05 by: Georg D.
hi, with struct C { string f1; }; class A
0
275
thread by: Neil Zanella | last post Jul 22 '05 by: Neil Zanella
Hello, AFAIK the only way to initialize a reference variable defined inside a class is to initialize it in an initializer list. However, when there are multiple constructors, this means that the initializer lists have to be cut and pasted from one constructor to another. This does not seem to lend itself particularly well to...

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.