Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Problems with Strings

Hello Tim
    When I see your code, I get a little bit confused.  Thus I assume that you 
use c code instead of fortran code.
  
1)
char name(dim2, dim30);   // it seems to be a prototype of function call, 
                          // I am not sure whether you have a function call
                          // defined by you named 
                          // char name(int ,int );
                          // if you don't, you could try the following ex.

As I know, if you want to declare two strings, you might use

char* name[2];   // string array
name[0]="John";  // assign first one
name[1]="Paul";  // assign second one

or
char name[2][30];
strncpy(name[0],"John",29);
strncpy(name[1],"Paul",29);

2)
ncvarget(cdfid, start, count, &value);

In order to make sure this function call, I check ncvarget arguments and it 
shows

int ncvarget(int cdfid,int varid,long start[],long count[],void* value);

If you still use netlib, it seems that you miss an argument varid unless you 
write your own function w/ same name ncvarget under c++ compiler.

Hope this help!
cheers
Yu-Long

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690