473,543 Members | 1,999 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.
4
2,272
thread by: Martinfnp | last post Feb 17 '06 by: Mark McIntyre
Hello all, I'm completely new in theory of C compiler and it's support for multi-core hardware. Does anybody know whether compiler for multi-core and SMP/AMP/BMP does need some special internal features? I'm not talking right know about libs, just translation of the C code into the instructions. I still understand that the most responsibility...
3
2,466
thread by: agalkin | last post Feb 17 '06 by: Roland Pibinger
Does anyone know any C/C++ source code for parsing CGI input string into name/value pairs? The only condition is not using any templates.
1
1,673
thread by: jn | last post Feb 17 '06 by: Victor Bazarov
Hi everyone, I was trying to implement a design when I've found what seems a limitation of standard C++. I can't specialize an inner class in this way: template <class ARG> template <> class Outer<ARG>::Inner<int> {
6
2,660
thread by: Scott Kilpatrick | last post Feb 17 '06 by: Jeff Flinn
Let's say I have a hacked-up polymorphic container that holds variables of type: struct poly { union { int *i; double *d; complex<double> *c; } value; char type;
10
4,900
thread by: Allerdyce.John | last post Feb 17 '06 by: Default User
Hi, I have a class with a STL vector as it attribute. How can I create a method which just return a 'read-only' view? (i.e. the caller of the function can only read the vector, not write it)? class A { private: vector<int> _v; public:
12
1,967
thread by: Viru Rathore | last post Feb 17 '06 by: Default User
If struct keyword is support the all functionallity of class keyword, only differance i have found is accessibility of member is different in struct is public and class has private. This accessbility feature user can got by using Accessor public, private or protected. So why class keyword is implemented in C++.
4
2,241
thread by: Rafał Maj Raf256 | last post Feb 17 '06 by: AnonMail2005
Hi, I wrote few filters working on streams of bytes, in example enciption, UTF-8 decoding and such. Now I wonder how can I turn them into classes derived from std::stream(?) or in other way to use them with code working on std::stream std::ifsteam and such. Keyword codecvc is probably related. With "connecting to std:: streams/strings" I...
8
1,452
thread by: morphex | last post Feb 17 '06 by: CBFalconer
Hi, I'm a python programmer that's started to play a bit with C as I'll probably have to make C extensions eventually.. I made this little program that I'd like to get feedback on, it's basically a find substring and return pointer to it function and tests for it.. Could this be done better/differently? Is anything fundamentally wrong?
13
1,571
thread by: jw | last post Feb 17 '06 by: Arjun Thounaojam
what is its output and why? #include<iostream> using namespace std; #define abs(x) (x>0 ? x:-x) void main() { int a=3,b=5;
4
1,731
thread by: marko.suonpera | last post Feb 17 '06 by: AnonMail2005
How to create a buffer of memory in C++, whose size can dynamically grow and shrink as needed? This is used for buffering input/output. Several variable types, such as int and double are read and written in this buffer in specific order. Currently I use a fixed size array: char *data = new char; I thought about std::vector<char> but can I...
3
1,600
thread by: utab | last post Feb 17 '06 by: Victor Bazarov
Dear, The thing I would like to do is to write a function(count) that counts the occurence of words in my input. If the vector is like "st1" "st1" "st2" "st2" "st2"
6
16,521
thread by: Steve | last post Feb 17 '06 by: Dietmar Kuehl
Hi, I have some code which compiles with Metrowerks CodeWarrior 9.6, Visual Studio 2005 (both targeted to Windows). Or, at least, it did until I started using size_t. CodeWarrior has size_t declared in the std namespace (and complains otherwise).
4
3,693
thread by: Ben Pope | last post Feb 17 '06 by: Ben Pope
Hi, The following code compiles with Comeau Online, but not MSVC 8.0. Comeau issues a warning that return 0 is unreachable. #include <sstream> #include <iostream>
13
2,447
thread by: vgame64 | last post Feb 17 '06 by: osmium
Hi, I have been struggling with writing a program for a few hours. The requirements are that: """You will be writing a program which will determine whether a date is valid in terms of days in that month. We are assuming that the year will be valid 4 digit integer. So you don't have to think much about that(in terms of validation) except for...
10
3,471
c
thread by: eberhard janssen | last post Feb 17 '06 by: Marcelo Pinto
c
4
2,070
thread by: Fraser Ross | last post Feb 17 '06 by: Victor Bazarov
Functors taking 1 argument for operator() should inherit from unary_function and those with 2 arguments should inherit from binary_function. If a functor has zero arguments for its operator() should it inherit from anything to make it adaptable? I've not heard of anything before which is surprising. If books don't talk about it then its an...
2
2,301
thread by: Speed | last post Feb 17 '06 by: Ben Pfaff
Could you please tell me which is the most efficient of way writing a BOOLEAN array to a file. Thanks a ton. Speed
9
1,343
thread by: Jordan Abel | last post Feb 17 '06 by: Jordan Abel
Was wondering what people think of this header file: #ifdef MALLOC_H #define MALLOC_H # ifdef __cplusplus # include <cstdlib> struct voidptr_ { void *x; template <typename T> inline operator T * () {
9
3,311
thread by: Kobe | last post Feb 17 '06 by: Howard
Is there any difference in: template <class T> vs. template <typename T> ?
3
2,238
thread by: slonial | last post Feb 17 '06 by: AnonMail2005
Hi, I am using two STL maps as data member for COM server with VC++6.0.These two maps are unrelated in the sense that they are storing different data. first map is of type(6 MB in size) std::map<long,ISumInfo*>
2
2,302
thread by: Jude | last post Feb 17 '06 by: Martin Ambuhl
here is the source code: #include<stdio.h> int main() { float f; scanf("%d%f",&f); printf("The float is %10.5f\n",f); return 0; } when I input 12345.11111,the output is 12345.11133.
3
329
thread by: roberts.noah | last post Feb 17 '06 by: Thomas Tutone
Scott Myers discusses the 'costs' of exceptions even when not being used vs. when you have a try/catch block vs. when you have to throw an exception. He leads you to believe that these costs are quite significant with a 10% increase in code size and slow down just by having the capability to use exceptions. He admits to not really having...
3
1,564
thread by: Tomás | last post Feb 17 '06 by: Howard
class Monkey { int cow() { static int k = 4; ++k; return k; }
0
1,252
thread by: KevinGPO | last post Feb 17 '06 by: KevinGPO
Am trying to write a program when given a folder name path, it will traverse/recursively go through the whole folder & sub-folders, opening each file. How can I go about this in C++? I want to write a ASP, ASPX, PHP, JS, XSL comment remover for web applications using state machine. I have found a C/C++ comment remover and will modify...
3
5,756
thread by: Bernd Muent | last post Feb 17 '06 by: roberts.noah
Hi, I'm looking for a c/C++ library (suitable for Linux and Windows) to parse pdf documents. I only need the plain text and defined page breaks as output. Parsing trough a system ("pdftotext ..."); does this for me, but I'm looking for a more elegant way using a library. xpdf does not come with any library nor API documentation. Thanks...

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.