473,543 Members | 2,496 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.
2
3,249
thread by: Lokicer | last post Jul 23 '05 by: REH
Hi I note there are two functions putch() and _putch() in VC++ Library. Which one should be used under specified situation. What is the difference between putch() and _putch()? Thanks!
2
2,443
thread by: Mike | last post Jul 23 '05 by: Matthias Kaeppler
Hi, I have a file descriptor of an open file and I would like to know through C/C++ API how to query its read/write/exec permissions. Thanks.
2
2,087
thread by: Matthias Kaeppler | last post Jul 23 '05 by: Victor Bazarov
Hi, I'm holding a vector of boost::filesystem::pathS and a vector of pointers to them. I use the reserve member function on both to reserve space for 500 files. That means, for the 501th file added, the vector will grow to hold 1000 files right? Well, as soon as this happens I am getting a segmentation fault. I'm sure this is the reason,...
2
1,568
thread by: Pratts | last post Jul 23 '05 by: Default User
hi all me Pratts wants to have my account in Gmail but i am not having the invitation for this . if any one can invite me for this it will be a great help. take care byEEEEEEEEEEEEEEEEeee
2
3,176
thread by: Lokicer | last post Jul 23 '05 by: Ivan Vecerina
Hi! I am a newbie in C++, it seems compiler must see the source code of template classes(with .h files and .cpp files£©when compile. I want to prevent others from getting .cpp files. How should i do? Thanks!
2
3,635
thread by: Gernot Frisch | last post Jul 23 '05 by: Gernot Frisch
bool isOlderThanToday(const char* pDate) { // How to do this? } void main() { const char* pDate = "29-Feb-2005"; if (isOlderThanToday(pDate))
2
2,036
thread by: Eat_My_Shortz | last post Jul 23 '05 by: Eat_My_Shortz
I'm trying to interoperate between file IO operations, on an open file, between unmanaged C++ code and Managed C++, using the .NET framework. Basically, at present, I have a C-style FILE* object, with an open file. I would like to do some operations on this file, then while it's still open, convert it into a .NET FileStream and do some...
2
280
thread by: J. Wolfram | last post Jul 23 '05 by: Kanenas
Hi! I need to write a template function which accepts a pointer (and a parameter for the byte-offset between the elements and a parameter for the number of elements.). The different possible types which the pointer is pointing at can be for example:
2
1,537
thread by: Kai Wu | last post Jul 23 '05 by: Matt Bitten
Hello, struct S{ friend class B; private: int i; }; class B{ B(){}
2
3,190
thread by: deancoo | last post Jul 23 '05 by: deancoo
Yet another question... I have a container (vector say) containing my class objects. I've overloaded the less than operator in my class definition to allow sorting based on a certain attribute of the class. Now this is exactly what I need, most of the time. I've found a couple of instances where I would like to be able to sort (using the...
2
1,108
thread by: Alex | last post Jul 23 '05 by: Alex
The following simplified code reproduces my problem: #include <iostream> struct MyTypeHolder { typedef int MyType; }; struct MyOp
2
1,513
thread by: nin234 | last post Jul 23 '05 by: red floyd
My apologies in advance if any one is offended by this post. I have an unstable job in a start up company and thought of sharpening my skill sets. I noticed that many companies are asking for boost and austria C++ library knowledge. I am thinking of using that in my project/learning them. For the past 20 months , I developed a fairly...
2
1,502
thread by: Dave | last post Jul 23 '05 by: Jonathan Turkanis
Hello all, I have a class that contains a large number of discrete pieces of state information. Any combination of these member variables might be valid for a given object. Any given member variable might be used or unused in a given object. For each field, there is a FieldIsValid() member function that must be called before accessing or...
2
1,247
thread by: john townsley | last post Jul 23 '05 by: Howard
i have a .cpp file and i want to have my class and member functions in a seperate file. if i put the class heading file in a .h and the member functions for the class in a .cpp. how do i compile the 2 .cpp files eg 1 with class stuff and other main(). i know i include the .h file in the .cpp class member file but i cant compile the project...
2
2,432
thread by: franklini | last post Jul 23 '05 by: franklini
hello people i. can anybody help me, i dont know what is wrong with this class. it has something to do with the me trying to override the input output stream. if i dont override it, it works fine. i would forget overriding it but i have to do it because its a coursework. here is a simple version of the class #include <iostream> #include...
2
1,824
thread by: Derek | last post Jul 23 '05 by: Ron Natalie
This isn't exactly a language question, but I'm curious if any of the veteran programmers out there could recommend a static analysis tool for C++. Specifically, I'm looking for something that can flag unreachable code, possible security errors like buffer overflows, and identify unused entities. It would also be great if said tool could...
2
2,284
thread by: unspammable | last post Jul 23 '05 by: deanbrown3d
Several C++ compilers now allow precompiled headers, supposedly as a compile-time optimization. I personally do not use them, although I code mostly in VC++ (which has a tendency to shove PCH down your throat), because: a. When headers are lumped together into one huge entity the code loses a sense of who-uses-what, or so it seems to me. I...
2
3,189
thread by: Zaharije Pasalic | last post Jul 23 '05 by: Dietmar Kuehl
What is purpose of rdbuf methode of stream class? Is rdbuf create new buffer or just return some kind of pointer to existing? Thanks, Zaharije Pasalic
2
1,338
thread by: Richard Cavell | last post Jul 23 '05 by: Rob Williscroft
#include <stdint.h> class uint128bit { public: uint64_t bits0to63; uint64_t bits64to127; uint128bit operator= (uint128bit op2) { bits0to63 = op2.bits0to63; bits64to127 = op2.bits64to127; return *this; }
2
2,682
thread by: Søren Holstebroe | last post Jul 23 '05 by: Søren Holstebroe
Hi there, I'm having a struggle with GNU g++ (3.3.5) and inheritance of typedefs in STL containers. I'm trying to port some old code I wrote with MS Visual C++ and it looks like there is a discrepancy in the STL implementation or at least interpretation of the standard (I trust g++ most on the latter). To the case: While this compiles...
2
1,090
thread by: Martin T. | last post Jul 23 '05 by: Martin T.
Hello. Is a static Variable in a member function of a class static with regard to one object, or is it static for all objects of the class? That is: class A { // ... void func() {
2
1,378
thread by: ceo | last post Jul 23 '05 by: ceo
Hi there, I'm trying to overload insertion (<<) and extraction (>>) operators and the program yields output I didn't expect. Could someone please clarify what's wrong with my program. Thanks, Ceo // program start
2
261
thread by: BCC | last post Jul 23 '05 by: Old Wolf
I have two vectors of objects, and these objects contain a double, 'ref_mass'. I want to remove the elements in one list from the other. My erase seems to work okay, except that after erasing the objects (successfully), my 'clean' vector is still the same length as the original. And if the vector had a length of 100, and I erase 10, the last...
2
2,266
thread by: Anargyros L. Papadopoulos | last post Jul 23 '05 by: rajkumar
given: class A { // ... }; class B : public class A { // ... } void some_fun()
2
1,399
thread by: Lord Phoenix | last post Jul 23 '05 by: Lord Phoenix
Hi everyone, I am quite new here, and actually no so old to C/C++ either. To put things in perspctive I only use C or rather C++ (MSCV 6) to build tool library's (either standard DLL or COM / OCX), so my knowledge is pretty much rudimentary complemented by some experience and a lot of wizard / mfc usage. Now for my problem:

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.