Avoiding use of a getter532 (6/21/2012 8:33:47 PM) comp.lang.c++ I was wondering if I could cut down, or avoid, the use of a getter
function.
In my program, I have a class Note which represents a note. Originally
it had lots of functions, but to try and cut down on this... Paul
Style question - calling default from several places926 (10/31/2011 8:27:42 PM) comp.lang.c++ I have a style question. In my code, I have a function that receives messages, and deals with some of them while passing others on to a further function. For instance: LRESULT CALLBACK WndProc(HWND hWnd, UINT ... Paul
Immediate arrays739 (9/8/2011 11:08:49 PM) comp.lang.c++ Is there a way to have an array temporarily without giving it a name? For instance, can you do something along the lines of: char *str; str = { "Tom", "Dick", "Harry" } [2]; Many thanks. Paul. ... Paul
Unwanted toolbars in IE047 (6/7/2011 9:17:59 PM) comp.programming (If anyone can suggest a better newsgroup I'm all ears...) I recently downloaded a program called "What's my computer doing?" from a firm called Softonic, having seen it recommended by the online Guardian. One... Paul
Problems with mktime430 (4/4/2011 6:58:36 PM) comp.lang.c++ I'm trying to write a program that will show the time at various different places. The idea is to get the GMT time, adjust it for the correct time zone offset (including DST if appropriate) and display it. My f... Paul
Handling WM_COMMAND3247 (11/19/2010 12:15:53 PM) comp.os.ms-windows.programmer.win32 I think I'm looking here more for reassurance than actual information,
but bear with me...
I have a program which puts a listbox on the screen and needs to
respond when the user double-clicks on it. At pre... Paul
Peace and quiet for youngsters235 (11/19/2010 11:27:23 AM) comp.programming A slightly off-topic discussion... My job is not in computer programming, but it requires reading through and assessing a lot of information. In the old days this would mainly be on paper but nowaday nearly al... Paul
Reference to pointer to const6122 (8/11/2010 8:52:18 PM) comp.lang.c++ Consider the following bit of code:
int find(char * & in, char ch) {
for ( ; *in; in++) if (*in == ch) return 1;
return 0; }
void replaceonce(char *in, char from, char to) {
if (find(in, from)) *in = t... Paul
Wasteful use of fonts?10107 (4/9/2010 11:04:31 AM) comp.os.ms-windows.programmer.win32 My code seems to be working, but I am worried that it may be very
wasteful. The actual code is a bit complicated, but here is a working
cut-down example that (I think) illustrates the point:
void makeitali... Paul
Cloning members of a hierarchy6160 (2/1/2010 7:45:00 PM) comp.lang.c++ I've got various classes derived (directly or indirectly) from a
single base, and want a function to make a copy of a given object. My
code is along the following lines:
class Base {
public:
int b;
... Paul
reference type for C1605 (5/16/2013 2:08:43 PM) comp.lang.c I like the reference type that has been introduced with C++
I wondered why isn't that feature retrofitted in C.
Is there something hindering it?
thx - roar -
... roland.arthaud(12)
Favourite Pattern for Processing Zero, Once, Multiple2016 (1/10/2013 10:53:29 PM) comp.lang.c Suppose you have a function 'bar' that returns a value that means one of:
- Do 'foo' zero times
- Do 'foo' one time
- Do 'foo' more than one time
What's your favourite way of handling such a valu... sha0.miller(876)
What does !! do?3227 (1/23/2013 3:24:08 PM) comp.lang.c++ I haven't seen this syntax before. What does "!!" do in C++?
As in this statement
int t = !!(x & size);
Thanks!
B
... bint1668(31)
linked list #6414 (2/21/2013 6:33:34 AM) comp.lang.c++ #include
using namespace std;
struct node {
int data;
node* next;
};
int main() {
node* head;
node* newnode;
head=NULL;
for (int i=0; idata=i+1;
newno... gunitinug(1)
How to arrange many files of C source code2426 (3/2/2013 11:17:44 AM) comp.lang.c Up to now I have usually written C modules as stand alone programs and
stored them in separate directories. This has been OK but is
inflexible, making interaction between them and having multiple
generations... james.harris.18827(31)
Why is my code showing this error?2319 (3/5/2013 5:03:06 AM) comp.lang.c++ My compiler is showing this error:
Run-Time Check Failure #3 - The variable 'math' is being used without being initialized.
Here is my code:
// CMD Application
// Created by Eli. M
#include
using... techgeek201(57)
passing var args as-is to a function107 (3/25/2013 9:44:24 AM) comp.lang.c i have a common function which takes variable parameters as an argument,
depending on the type (the first arg) i want to call the appropriate
function with rest of the param list, is there any way to do this ... sinbad.sinbad(155)
C++ rounds up my decimals1113 (4/10/2013 2:32:17 AM) comp.lang.c++ Hi I made this code:
#include
#include
using namespace std;
int main() {
int getIntx()
unsigned int ans;
double mfirstnum, msecondnum;
cout > x)) {
cin.clear();
cin.ignore(numeric_limits::m... techgeek201(57)
Getting some namespace features in C with structs95 (5/3/2013 8:51:15 AM) comp.lang.c One thing I like about some other (non-C) languages is their
management of names so I got to wondering: Would it be a good or a bad
idea to use C's structs to provide some of the features of namespaces?
Un... james.harris.18827(31)