| |
thread by: param |
last post Feb 23 '06 by: Ivan Vecerina
Hi,
I need to write a MACRO which helps to call different functions
depending upon it's value say On or OFF. If its' value is ON the
function1 should get called and if value is OFF function2 gets called .
It's like same as assert gets executed when NDEBUG is not defined at
the start of code. If NDEBUG is defined assert doesn't gets called...
|
thread by: jesper |
last post Feb 23 '06 by: Alf P. Steinbach
Hi.
This might be to basic, or of topic, or just plain silly. But, Is there
a nice way to
construct objects dynamically from a data stream (file, socket, memory)
without
prior enumerating classes?
With enumerating classes I mean solutions like:
(pseudo code 1)
class B
{
|
thread by: kernelxu |
last post Feb 23 '06 by: kernelxu
Hi,folks.
I got some suggestion about bitwise shift from <The C Book, second
edition>(written by Mike Banahan, Declan Brady and Mark Doran,
originally published by Addison Wesley in 1991. This version is made
freely available at http://publications.gbdirect.co.uk/c_book/)
....snip...
The position is clearer if an unsigned operand is right...
|
thread by: ken.carlino |
last post Feb 23 '06 by: Victor Bazarov
Hi,
I have the following code which comples:
bool contains(vector<A*>& cgl, A* cg) {
vector<A*>::iterator iter = find_if ( cgl.begin(), cgl.end(), bind(
equal_to<A*>(), _1, cg ));
return (iter != cgl.end());
}
|
thread by: siegfried |
last post Feb 23 '06 by: siegfried
The std::lower_bound function requires a function pointer as its last argument. This is simple if you don't overload.
How do I I call std::lower_bound with the last argument a function pointer when I need to pass a certain instance of an overloaded function?
Thanks,
Siegfried
|
thread by: mayershome |
last post Feb 23 '06 by: Mark F. Haigh
Hi!
I'dont have any experiences in programming... what language should I
start learning????
C? C++ or Java`?
greetz
|
thread by: centurian |
last post Feb 23 '06 by: Csaba
I have compiled following program with g++/gcc 3.3.1 and "MS Visual C++
6" and it ran without any errors. Does this thing make any sense? Is it
of some use or some problem with grammar/CFG of c/c++?
#include <stdio.h>
int func()
{
int x;
return x,x;
}
|
| |
thread by: John |
last post Feb 23 '06 by: kanze
Is there a good implementation of the boss-worker model
in C++ using pthreads? I have an array of objects A that each
need processing and I have p threads running simultaneosly.
Any object can be processed by any thread. All objects need
to get processed.
Does anyone know of a good design/implementation of this problem
in C++?
Thanks a...
|
thread by: ashu |
last post Feb 23 '06 by: pete
lets look at the code given below
here i m trying to do mudular programming
/* this is my main prog.*/
/*mmod.c*/
#include<stdio.h>
#include "mod1.h"
int main(void)
{
|
thread by: szabi |
last post Feb 23 '06 by: benben
Hi!
I have seen in a couple of libraries that object are never passed
through dll boundary, instead the results are returned through an
output parameter reference like:
void f(std::string &s)
{
s = "foo";
}
|
thread by: bobrics |
last post Feb 22 '06 by: Rod Pemberton
Hi,
I would like to create a packet for a RAW socket transfer. Please let
me know if this is the right approach.
1. First, I am creating a header structure where I store all the
information I would like to put in the header of a packet.
2. I know the size of data I will send and the header size in bytes, so
I allocate the space in memory...
|
thread by: amruta |
last post Feb 22 '06 by: Rod Pemberton
hi,
i m new in programming.at present i m learning computer languages.
i just want to know how u can develop a skills of any language, how u
can be master in any languages.
can any one help me.
|
thread by: jortizclaver |
last post Feb 22 '06 by: Keith Thompson
Hi,
I have a very simple library that wraps a Timer class and a test
program linked to it.
First of all, I compile the library and the main without the KPIC flag.
Then, I execute the program and, while it's running, I add some dummy
sentence to the library and recompile it. Nothing happens to the binary
running. It keep unaware of...
|
thread by: Martin Jřrgensen |
last post Feb 22 '06 by: Ben Pope
Hi,
I get this using g++:
main.cpp:9: error: new types may not be defined in a return type
main.cpp:9: note: (perhaps a semicolon is missing after the definition
of 'vector')
main.cpp:9: error: two or more data types in declaration of 'set'
I don't really see the problem... Here's the code:
|
thread by: LuB |
last post Feb 22 '06 by: Bo Persson
This isn't a C++ question per se ... but rather, I'm posting this bcs I
want the answer from a C++ language perspective. Hope that makes sense.
I was reading Peter van der Linden's "Expert C Programming: Deep C
Secrets" and came across the following statement:
"Avoid unnecessary complexity by minimizing your use of unsigned types....
|
| |
thread by: Plissken.s |
last post Feb 22 '06 by: TB
I have a template function which print out the content of a list: The
following compiles:
void PrintInt2 (int i) {
cout << i << " ";
}
template <class T>
void printList(T& list) {
|
thread by: Allan A. |
last post Feb 22 '06 by: mlimber
Hi all. Is there any way to initialize an entire array in the constructor.
The code below does not work. Thanks.
class x {
public:
int array;
x();
};
|
thread by: kathy |
last post Feb 22 '06 by: Tomás
If I have 2D array like:
int **p;
p = new int*;
for(int i=0;i<10;i++)
{
p = new int;
}
|
thread by: cmazur |
last post Feb 22 '06 by: cmazur
I'm currently getting a illegal direction error when using the following code.
The error is coming up when I set up the for loop
int saveBook(vector<Address*> a, ofstream& out)
{
//For loop that writes to the temporary file in the correct
//format in order for it to be read in to the progam again
//cout << (*a).size();
...
|
thread by: cdg |
last post Feb 22 '06 by: cdg
Could anyone tell me why a function return with this program is not
returning to "main". The program will compile and should be
self-explanatory. And any suggestions for improvements would be appreciated
also.
The function is HashMilliTime at the end of the program.
#include <sys/timeb.h>
#include <iostream.h>
#include <string.h>...
|
thread by: Peter Jansson |
last post Feb 22 '06 by: siegfried
Dear group,
I have been struggling to get a simple program for inserting and
extracting std::tm objects to/from streams to work. The code below tries
to read a std::tm object from a std::istringstream but fails to do so,
could anybody see what is wrong with the code? (Output follows the code.)
I fear that I have not completely grasped how...
|
thread by: riya1012 |
last post Feb 22 '06 by: Default User
hello guys,
I need some help from you. I am doing a DSP project and for that I need
to do some C coding for the conversion of sample data which is in
floating point representation to fixed point representation.
the sample data is in floating point like
0.224128
2.299965
0.448350
-1.779926
|
thread by: andrew queisser |
last post Feb 22 '06 by: Walter Roberson
Hi all,
I'm working on a small embedded system (think microcontroller with uC/OS-II)
and I'm considering which convention to use for error handling in our
internal "API". Since I'm using two existing APIs (a low-level HAL and the
OS API) I already have mixed conventions since some return 0 for failure,
some return 0 for "no-error", etc.
...
|
| |
thread by: felixnielsen |
last post Feb 22 '06 by: Daniel T.
Some might remember that i, not so long ago, started a treath or two
about a weird 3d labyrinth. I now have a working code, that i want to
share, hear comments, advice, ect., but first let me explain what its
all about.
The whole labyrinth is a cubic in its self and it contains x^3 cubic
rooms.
The labyrinth is infinite/finite, it has no...
|
thread by: aimal |
last post Feb 22 '06 by: roberts.noah
Hi,
I am writing a program that needs to read the screen resolution and
then size a window according to it. My program will run on linux
machines. Can anybody help me on how it can be done?
Thanks
Aimal
|