Identifying error that is causing "non-POD type 'class segment' "
===

*Section of my code where error is occuring:*

    int disk::access (const char fname[]){
    
    	int char_count=77;
    	int actual_count=0; //just to pass the tests.
    	char c;
    
    	cout << "the file name is " << fname << ", and the mode is " << mode << endl;
    	if(strcmp(mode, "w")==0){
    	    for (int i = 0; i < size; i++) {
    	        //cout << "sgm to be written is " << sgm[i];
    	        fp=fopen(fname, "w");
    	        fprintf(fp, "%s\n",sgm[i]);
    	     }
    		fclose(fp);
    	}       
    	if(strcmp(mode,"a")==0){
    		fp=fopen(fname, "a");
    		fprintf(fp, "%s\n", sgm);
    		fclose(fp);
    	}
    
    	fp=fopen(fname, "r");
    	
    	do{
    	    c=fgetc(fp);
    	    if(c!=' ' && c!='\n')
    	    actual_count++;	
    	 }while(c!=EOF);
    	fclose(fp);
    	 
    	
    	return actual_count;        
    }

*my error:*

> disk.cpp: In member function 'int disk::access(const char*)':

> disk.cpp:67: warning: cannot pass objects of non-POD type 'class
> segment' through '...'; call will abort at runtime

***EDIT*** line 67 is: fprintf(fp, "%s\n",sgm[i]);

I haven't come across a warning like this before. I did some searching and from what I gathered POD is "plain old data that is a struct without constructors, destructors and virtual members functions." -Greg Hewgill

So if I understood that correctly, my error is that I do have constructors or destructors and or virtual member functions because it is non-POD?

I think I'm just confusing myself, I'm not sure how to go about fixing this error or even pinpointing where the problem is occuring.

All suggestions are welcome and greatly appreciated,

thanks.