General C++ Programming - February 2009 (Page 3)

How to Search for a Piece of Text in Binary File by Using fstream - C/C++?
 
I got a binary file, i opened the file. I need to look for this ASCII "255.255.255.255" which of type const char *, and then replace it with the user newly inse...
[2 replies] Last: Hm, ok...I see Excuse me, i got one more question... Here is wha... (by f ben isaac)
Static Class Members Giving Me Grief
 
Not to sure how to use static members in a class. Wont give you my actual code but an example of what I want and what I need to change in order to get this to w...
[5 replies] Last: Alright cheers Bazzy and titon, will give it a shot now and see if it ... (by Mythios)
dynamic 2d array allocation as instance variable
 
I would like to declare a dynamically sized 2d array as an instance variable. I'm declaring it using variables that are defined as constants. The constructor ...
[1 reply] : You need to make cell and alive int** and bool** and dynamically alloc... (by jsmith)
All about interrupts
 
I need to know how to set up an interrupt in C for microcontrollers. Also, is it possible to have an interrupt in C++ without a microcontroller? For example,...
[1 reply] : Unfortunately, I'm pretty sure microcontroller interrupt subroutines a... (by jdd)
by wretch
code review, homewrk: 114 lines, beginr polymorphism, factory method
 
Well since most of you program all day, the last thing you probably want to do is look at code. But if you are bored to death, I'm taking a Design Patterns c...
[5 replies] Last: Well, actually, you should make the data members of Employee protected... (by seymore15074)
Qt in Cygwin
 
Has anyone installed and made a hello world program with Qt in Cygwin? I'm getting it to compile but no window is showing up when I run the program. Could y...
[3 replies] Last: Bug fix! ;) ###########################$$$$$$$$$$$$$$$$$$$$$$$$$... (by seymore15074)
by akn
Unresolved external 'class::member' referenced from class.OBJ
 
Hi, I have a class linestorage which has a static member S (represents lines of words of characters). The problem is I don't know how to access this member in...
[3 replies] Last: Just declare it outside the class vector <vector <vector<char> > > ... (by Bazzy)
Read 24bit ?
 
Hello, How to read unsigned 24bit integer data ?
[5 replies] Last: Hello Grey Wolf , I don't know what to say but THANKS YOU VERY MUCH!!... (by nhatdung)
Prime Number Series
 
//here is the code in C++ for outputting prime numbers below any user input integer #include<iostream.h> #include<math.h> int PN(int num) { int div, p...
[2 replies] Last: You can use the code-format (#-format on your right when posting) to u... (by Scipio)
Syntax error in templated linked list
 
// I didn't want to change the original post because it might confuse people. My new question is below. I am having trouble with what I think is a memory le...
[6 replies] Last: You were correct, I guess it has to be: template <class myType> cKer... (by stringplayer92)
by g0dwyn
Access Pecularities with Pairs in std::Map
 
Hey everyone, This has always confused me. I'm using the default STL implementation provided by the MinGW suite, and when I use an iterator to the map, I ca...
[1 reply] : #include <utility> for std::pair operator* and operator-> on map it... (by jsmith)
Register Storage Class
 
Does anyone still use the register storage class or just rely on the compiler to optimize? Also, is there a way to identify which variables the compiler has ...
[1 reply] : No and no, not without looking at the assembly code generated by the c... (by jsmith)
multiple inheritance question
 
Should I perceive it as C++ flaw or there is some good reason why it is like that: g++ -o XXX XXX.cpp XXX.cpp: In function 'int main(int, char**)': XXX.cpp...
[8 replies] Last: Ambiguity checking occurs before type checking, so overloading is not ... (by n4nature)
Floor
 
double computeTotal(double salesAmt) { double Total; Total = salesAmt + 0.05*salesAmt; cout << fixed << setprecision(2) << floor(Total) << endl; retur...
[2 replies] Last: tks it works, i spent some time troubleshoot it.. tks alot, u save my ... (by littleimps)
by masiht
call by value call by reference difference
 
Can anyone please explain the difference between call by value and call by reference in simple words , I read the explaination here but didn't get it. please t...
[10 replies] Last: like when the function is call by reference if the parameters have * a... (by masiht)
Difference between typename and class?
 
Hey guys, just wondering what the difference is with this: template <class T> class GiveValues { public: T values ; GiveValues (T first, T sec...
[2 replies] Last: Cheers for that - as you can see the above code is from that tutorial ... (by Mythios)
Circular includes and forward declarations
 
Hi, so I'm having a bit of an issue, and I know it has to do with the fact that I have circular includes, but it seems somewhat necessary. Here's essentially w...
[1 reply] : You can declare a class, but not if that is going to be a base class a... (by Bazzy)
Magic Square combinations lister (logic error)
 
Hi, I have been working on a C++ program that will list all possible combinations (should be 3456 combinations) of a 4 by 4 Magic Square. In case you don't ...
[7 replies] Last: tition, I finally got it working, but it's taking roughly a second and... (by jadmacro)
Operator Precedence - Any tips?
 
Hey guys, just wondering if use know any tips in remembering the operator precedence. As I have to start knowing these off by heart and I'm always putting a cou...
[6 replies] Last: Haha, thats pretty cool. Thanks a heap :)! (by Mythios)
NULL == 0?
 
Why are people writing "NULL" - it is longer!?
[8 replies] Last: For those interested in reading the most recent C++0x report, N2800, p... (by closed account z05DSL3A)
February 2009 Pages: 12345... 14
  Archived months: [jan2009] [mar2009]

This is an archived page. To post a new message, go to the current page.