[c-prog] difer btwn *ptr++ (*ptr)++

2006-12-06 Thread vineet kumar
hello friends ; i'm very confused tat wht would be d output of *ptr++ (*ptr)++ if ptr is a pointer. plzzz help me. VINEET - NOIDA - Find out what India is talking about on - Yahoo!

[c-prog] Regarding operator overloading

2006-12-06 Thread mano M
Hi, Why C++ doesn't allow few of the operator overloading?(like ::,?:,sizeof,.) Any Reason behind that? When new operator is required to be overload? Any concrete example. Thanks for the answer for the previous question. Regards Manoj

[c-prog] inter thread communication

2006-12-06 Thread Indika Bandara
hello, how is inter-thread communication done? say i want to send a string from thread_A(or main) to thread_B to print it on to stdout how can i do it? pipes are used between processes as opposed to threads isn't it? TIA indika

Re: [c-prog] inter thread communication

2006-12-06 Thread Ramprasad B
--- Indika Bandara [EMAIL PROTECTED] wrote: how is inter-thread communication done? Either one of the following - * Shared Memory * Port-Based Communication * Sockets * Message Queues * Distributed Objects - Ramprasad B

Re: [c-prog] inter thread communication

2006-12-06 Thread Saswat Praharaj
These are for inter process communication not thread communication. You got to use global variables. Use semaphores or any other locking mechanism to lock the variable. You should not modify the same variable in two different threads at the same time.That will create inconsistency. thread 1

Re: [c-prog] difer btwn *ptr++ (*ptr)++

2006-12-06 Thread Ramprasad B
--- vineet kumar [EMAIL PROTECTED] wrote: i'm very confused tat wht would be d output of *ptr++ (*ptr)++ *ptr++ - increment the value which ptr contains, that's addr of a data (*ptr)++ - increment value pointed to by ptr - Ramprasad B

Re: [c-prog] inter thread communication

2006-12-06 Thread Ramprasad B
--- Saswat Praharaj [EMAIL PROTECTED] wrote: These are for inter process communication not thread communication. What are threads then ? You got to use global variables. Use semaphores or any other locking mechanism to lock the variable. You should not modify the same variable in two

[c-prog] Re: inter thread communication

2006-12-06 Thread Indika Bandara
using global vars with mutexes is easy :-) can somebody explain other methods (probably with examples?) --- In c-prog@yahoogroups.com, Saswat Praharaj [EMAIL PROTECTED] wrote: These are for inter process communication not thread communication. You got to use global variables. Use semaphores

Re: [c-prog] inter thread communication

2006-12-06 Thread Saswat Praharaj
You are right . On Wed, 2006-12-06 at 03:38 -0800, Ramprasad B wrote: --- Saswat Praharaj [EMAIL PROTECTED] wrote: These are for inter process communication not thread communication. What are threads then ? You got to use global variables. Use semaphores or any other locking

Re: [c-prog] Re: inter thread communication

2006-12-06 Thread Ramprasad B
--- Indika Bandara [EMAIL PROTECTED] wrote: can somebody explain other methods (probably with examples?) Why don't you search internet ? Anyway you can go through - http://www.llnl.gov/computing/tutorials/pthreads/ - Ramprasad B

[c-prog] Re: How to execute DOS command

2006-12-06 Thread Nico Heinze
--- In c-prog@yahoogroups.com, rampavanck [EMAIL PROTECTED] wrote: Hi , How can we execute a dos command from the c program.please provide syntax deepak hi deepak, our frnds already told u that use system() function. nice u must use system() function which is in dos.h header file.

[c-prog] Re: Disable printf

2006-12-06 Thread Nico Heinze
--- In c-prog@yahoogroups.com, kldan_ng [EMAIL PROTECTED] wrote: I am working on a Memory Footprint Reduction project. I came across an idea to disable all printf statements so that less memory is required. In addition, when there is no single printf statement, the printf library will not be

[c-prog] Re: callbacks .. events

2006-12-06 Thread Nico Heinze
--- In c-prog@yahoogroups.com, Indika Bandara [EMAIL PROTECTED] wrote: thanks nico, just for curiosity .. can u tell me how are event handled in Unix.. by signals ? in some 3rd party libraries i have found things called callbacks which come into action when an event occurs. for example in

Re: [c-prog] difer btwn *ptr++ (*ptr)++

2006-12-06 Thread Pedro Izecksohn
--- Uma Maheswara Rao Lankoti [EMAIL PROTECTED] wrote: for *ptr++ : unary ++ operator is having higher priority than unary * operator. so *ptr++ is equal to *(ptr++). ie, its pointing to the value next to previously pointing one. Are you sure?

[c-prog] Re: callbacks .. events

2006-12-06 Thread Indika Bandara
thanks nico, well what im asking is similar to signals but not exactly that. for example when a signal sent the signal handler is called without any explicit call to it.(may be libc handles that) what i want is a similar thing, rather than a signal(which is OS specific) if i want some function

[c-prog] Re: inter thread communication

2006-12-06 Thread Indika Bandara
Would that include Globel data structures as well? yes, all objects --- In c-prog@yahoogroups.com, Benjamin Scott [EMAIL PROTECTED] wrote: Would that include Globel data structures as well? Want