473,748 Members | 2,574 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.
96
4,964
thread by: david ullua | last post Mar 5 '06 by: Charles Krug
I am reading "Joel on Software" these days, and am in stuck with the question of "how to calculate bitsize of a byte" which is listed as one of the basic interview questions in Joel's book. Anyone could give some ideas?I am expecting your reply. David.
19
1,836
thread by: Babis Haldas | last post Mar 5 '06 by: Tomás
i have if(i==1 && func1() ) do something if i!=1 , func1 doesnt run at all this is in my compiler is this because the compiler or because the stantard can i rely that in any system func1 will never run if i!=1 (so first agument is checked first)
7
1,669
thread by: Tomás | last post Mar 5 '06 by: Tomás
Let's write a header file which has all sorts of things in it which help a programmer overcome what some people may see as "warts in C++", or maybe things that are just more convenient or nicer to work with. For instance, if you want to default initialise something, you have to know what kind of type you're dealing with. A) Intrinsic int...
9
2,255
thread by: RajW | last post Mar 5 '06 by: RajW
Disclaimer: I'm new to C. I'm building a simple text based program and I'm not sure I'm designing it correctly. What I have is simple and it works but it just seems weird. Is there a better way? I do still have some debugging code in the subroutine to print out the key pressed. Basically menuinput() waits for the key press, and passes it...
12
3,734
thread by: al.cpwn | last post Mar 5 '06 by: Dietmar Kuehl
I recently bought this book, and wanted some recommendations on what are the most important lessons one should learn from this book. i.e. something that comes up frequently in large C++ based designs and will be useful to me over and over again. I am an undergrad student so I don't run into problems involving large projects (as I have never...
5
9,569
thread by: yusufm | last post Mar 5 '06 by: Dietmar Kuehl
Is there a findbugs type tool that analyzes C/C++ code? Thanks.
5
1,821
thread by: Kuljit | last post Mar 5 '06 by: Eric Sosman
Hello everyone, What are data type qualifers? - Kuljit Singh Tomar ..
3
6,243
thread by: Jeff | last post Mar 5 '06 by: TB
I have a question about potential memory leakage in a 2 dim array I have. If I say: vector< vector<int> > vec; vec.push_back( vector<int>() ); // initialize the row vec.push_back(1); vec.push_back(2);
9
2,548
thread by: Joseph Wakeling | last post Mar 5 '06 by: Ben Bacarisse
Hello all, I sometimes make use of global variables within modules, which I denote with "static" so that they will not be seen outside the module, and will preserve values between module calls. Recently I was looking back at a rather important function and found I'd forgotten to put the static declaration in place. I'm not worried about...
5
3,390
thread by: shahoo | last post Mar 5 '06 by: Ben Pope
Hi there everyone .I have a problem: I want to run my C/C++ program on a PC with no operating system.I mean a boot programm written in C/C++.How should I do that ?
5
2,696
thread by: cdg | last post Mar 5 '06 by: Maxim Yegorushkin
Could anyone explain how to write this sample program correctly. I need to convert an integer to a string. However, I would prefer to convert the integer to char array. But I didn`t want to use "itoa". And I am not that familar with using "stringstream". And is there better approach to converting integers to char arrays. #include <iostream>...
2
1,489
thread by: skishorev | last post Mar 5 '06 by: Maxim Yegorushkin
What is the use of This ptr.Follow the code snippet. class this_pointer { int data1; public: int getdata() { return this->data1; }
5
1,493
thread by: Scott | last post Mar 5 '06 by: Gavin Deane
Hello, I am writing a C++ class, as follows: class A { ... private: int i; B b;
9
2,180
thread by: piyush2884 | last post Mar 5 '06 by: Flash Gordon
hi guys, got anything on this issue?
0
1,670
thread by: Roula | last post Mar 5 '06 by: Roula
Ok, folks, more addons for our toolbar, including video... check it out. Articles NEW! Best director: The year of the auteur NEW! Profile: BROKEBACK MOUNTAIN NEW! Interview With Brokeback Mountain Director Ang Lee NEW! Profile: CAPOTE NEW! Interview With Capote Director: Bennett Miller NEW! Profile: CRASH
4
1,830
thread by: KL | last post Mar 5 '06 by: KL
Well, I got through those other hurdles, but now I am stuck with trying to get an iterator to work. I am having a problem with trying to iterate through the STL list container that I set up. I have the #include<list> and the using std::list; and then a using std::list<int>::iterator; but I get an error that says, "p3a.cpp:12: error:...
10
2,981
thread by: broeisi | last post Mar 5 '06 by: CBFalconer
What advantages does sscanf offer over scanf? I had the following code: #include <stdio.h> #include <string.h> int main(void) { int start, finish, values;
1
3,207
thread by: samuel.y.l.cheung | last post Mar 5 '06 by: samuel.y.l.cheung
Hi, I wrote a template to use copy() algorithm, called copyAll: template<class T> void copyAll(const T& src , T& dest ) { copy (src.begin(), src.end(), back_inserter(dest)); } but when I call it, I get a segmentation fault: Thread (Suspended: Signal 'SIGSEGV' received. Description:
2
3,305
thread by: berlin860 | last post Mar 5 '06 by: F. Meyer
hello everyone: I want to programming c++ with asm to simulate the getch(). getch() is included in <conio.h>, it's function is to get a character from keyboard, but not echo. my code as follow: char my_getch() { char chr;
1
378
thread by: Frank-René Schäfer | last post Mar 5 '06 by: Paul Mensonides
Is there a way to write code like #include IMPLEMENT_THIS(my_class, my_member_type) for what looks currently like #define __C my_class #define __MT my_member_type #include <my_implementer.i>
0
1,894
thread by: Ray Wesley Kinserlow Jr. | last post Mar 5 '06 by: Ray Wesley Kinserlow Jr.
We have been studying tail recursion in my computer class. The prof told us that some compilers will turn a tail recursion into an iteration thus allowing many, many function calls to the recursion. I have proved to myself that the two flavors of VC++ I have will do this but I cannot get the GNU G++ compiler to do so. It is run in unix on...
6
2,445
thread by: Andreas | last post Mar 5 '06 by: Andreas
Hi, to output the private data of a class I want to overload the operator<<. The Output should be written in a string-variable. To do this i have written the attached code: But the program-compilation aborts with the following error message: StreamKoord.cpp: In function `int main()':
4
1,922
thread by: joe | last post Mar 4 '06 by: Dave Townsend
I have the following header file generated by Java JNI's header file generator (see bottom). Obviously I will write a source file which will provide an implementation of these methods. I have a few questions regarding this: 1) Where is the class name defined? Is this a C++ class? It says "class TestAPIMsg" in a generated comment but I...
8
3,308
thread by: yossi.kreinin | last post Mar 4 '06 by: Mark McIntyre
Hi! When are multiple definitions of global variables with the same name considered legal in C, and how is it different from C++? It appears that in terms of assembly language, some C definitions are translated to "weak" symbols, in which case multiple definitions are merged by the linker, while some become "normal" symbols, triggering...
2
4,209
thread by: scottys0 | last post Mar 4 '06 by: scottys0
Hi everyboy, I'm working in an IOC-IBM (IBM open class) replamecent library. the code seens confused but , no, isn't. #define INumber long class IString : public std::string { private: ... // some control variables

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.