passing values from map to list

This is a discussion on passing values from map to list within the C++ Programming forums, part of the General Programming Boards category; hi happy new year, here "UF_STRING_t * sectionEditData" is pointer to the string structure of a single string to add ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    78

    Unhappy passing values from map to list

    hi happy new year,

    here "UF_STRING_t * sectionEditData" is pointer to the string structure of a single string to add or replace.

    but for some reason i am not getting output of"UF_MODL_replace_feat_strings" function"

    can anyone help me?






    Code:
    void defGeometry::ReplaceSpline(std::vector<struct geometricSection>sections)
    {
    	int j=1;
    	tag_t PartTag=NULL_TAG;
    	tag_t feat_tag=NULL_TAG;
    	char feat_name[]="THROUGH";
    	UF_STRING_t * sectionEditData=NULL;
    	sectionEditData= (UF_STRING_t *) malloc (sizeof(UF_STRING_t)*ActionSide.NumberOfSections);
    	PartTag=UF_PART_ask_display_part();
    	UF_CALL(UF_OBJ_cycle_by_name_and_type (PartTag, feat_name, UF_feature_type, FALSE, &feat_tag));
    if(!feat_tag)
    	{
    		sysLogPrint("Failed to create spline !");
    }
    else
    {
    	sysLogPrint("s.t=&#37;d",feat_tag);
    	
    }
    for(int i=0;i<ActionSide.NumberOfSections;i++ )
    {
    	int k=0;
    	UF_MODL_init_string_list(&sectionEditData[i]);
    	UF_MODL_create_string_list(1, 4, &sectionEditData[i]);
    	sectionEditData[i].string[0]=4;
    	sectionEditData[i].dir[0]=UF_MODL_CURVE_START_FROM_BEGIN;
    
    	for( map<int,tag_t>::iterator iter = sections[i].section_tags.begin();iter != sections[i].section_tags.end(); iter++)
    	{
    		sectionEditData[i].id[k]=(*iter).second;
    		k++;	
    	
    	if( j<=3)
    	{
    		if(!UF_CALL(UF_MODL_replace_feat_strings (feat_tag, UF_MODL_STRING_REPLACE, &sectionEditData[i], 1, j++)))
    		{
    			sysLogPrint("spline replaced j<=3");
    		}
    		else
    		{
    			sysLogPrint("spline not replacedj<=3");
    		}		
    	}
    	else
    	{
    		UF_CALL(UF_MODL_replace_feat_strings (feat_tag, UF_MODL_STRING_ADD, &sectionEditData[i], 1, (j++)-1));
    	}
    	
    	
    	UF_MODL_update ();
    	}
    }
    Last edited by chintugavali; 12-30-2007 at 11:28 PM.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    What's the error? Where's the error? Is sectionEditData[i].id[k] a tag_t?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pleas take a look & give a critique
    By sh3rpa in forum C++ Programming
    Replies: 14
    Last Post: 10-19-2007, 10:01 PM
  2. Reverse function for linked list
    By Brigs76 in forum C++ Programming
    Replies: 1
    Last Post: 10-25-2006, 10:01 AM
  3. Simple list code
    By JimpsEd in forum C Programming
    Replies: 1
    Last Post: 05-24-2006, 02:01 PM
  4. Replies: 6
    Last Post: 03-02-2005, 01:45 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21