Re: [AMBER] Small NAB program: Not getting desired output

From: Himanshu Joshi <>
Date: Fri, 17 Oct 2014 13:15:39 +0530

Dear Dac,
Thanks for your help,

n="" does not work for wc_helix giving segmentation fault.
So I have to go with n =NULL;

Somehow wc_helix returns the complimentary string to the other
sting if one is giviven NULL value as it is clear by output of this

molecule m1;
string n;
printf ("%s\n",n);
printf ("%s\n",n);



On Thu, Oct 16, 2014 at 5:41 PM, David A Case <>

> On Thu, Oct 16, 2014, Himanshu Joshi wrote:
> > When I redefine n=NULL before executing the wc_helix
> > for molecule m2 again in the program it works fine,
> >
> > But I don't understand why it doesn't take the NULL value
> > when I define it once.
> nab uses the Fortran convention for passing arguments to subroutines: it
> always passes arguments by reference, so they might be changed in the
> underlying routine (wc_helix, in this case). You should print out "n"
> after
> the first call, and see what is there.
> If you want an empty string, use: n = ""; in place of n=NULL;
> (although I guess the latter will work, but you are relying the details of
> how
> the nab compiler implements strings.)
> ...hope this helps...dac
> _______________________________________________
> AMBER mailing list

*With Regards,HIMANSHU JOSHI Graduate Scholar, Center for Condense Matter
TheoryDepartment of Physics IISc.,Bangalore India 560012*
AMBER mailing list
Received on Fri Oct 17 2014 - 01:00:01 PDT
Custom Search