thanks this seems fine.
On Wed, Sep 8, 2010 at 1:02 AM, albert theboss alberttheb...@gmail.comwrote:
typedef struct list node;
node a;
(float*)((char*)a+2)
is it correct ??
correct me i am wrong
--
You received this message because you are subscribed to the Google Groups
how we can access 2nd element of an struct defined as
struct {
int a;
flaot b;
}
we have given a void pointer of this struct. we dont know what is the
structre only knows 2nd element is a flaot type.
--
Thanks Regards
Ram Narayan Das
mob: +91 9177711195
--
You received this message because
that's because you are creating char str[20]; on the stack so when the
function createList completes all str [20] will be deleted from stack as a
part of stack unwinding. and next you are calling display where all the
references to name is removed and you are getting gabage value.to avoid this
you
make declaration of char str[20] to char
*str=(char*)malloc(20*sizeof(char));
and it will work .
On Wed, Aug 18, 2010 at 11:23 PM, Raj Jagvanshi raj.jagvan...@gmail.comwrote:
wats d problem in my display()
#includeiostream
#includemalloc.h
#include string.h
using namespace std;
no it head to head-next at the end of for loop block not at the beginning.
try out this
for (int t=0;t5;t++)
cout\nt;
On Thu, Aug 19, 2010 at 5:22 PM, vineeth mohan vm.vineethmo...@gmail.comwrote:
void display(Node *head)
{
cout\n;
for( ; head ; head=head-next)
shiftZeroOne(int *arr,int size)
{
int odd=1,even=0;
while(odd = size even =size)
{
if ( arr[even] != 1 )
even+=2;
if ( arr[odd] != 0 )
odd+=2;
if ( arr[even] == 1 arr[odd] == 0 )
{
arr[even]=0;
;
}
}
}
On Thu, Aug 19, 2010 at 7:00 PM, ram das ramnaraya...@gmail.com wrote:
shiftZeroOne(int *arr,int size)
{
int odd=1,even=0;
while(odd = size even =size)
{
if ( arr[even] != 1 )
even+=2;
if ( arr[odd] != 0 )
odd