znów konwersja

0
  	_vertexList[GetVertNum()+1] = "%d %d %d %d",GetVertNum()+1,atoi(_tokens.at(1).c_str()),atoi(_tokens.at(2).c_str()),GetFigNum()+1;

oczywiście powyższy kod nie działa, ale chodzi tu o ideologie mniej wiecej taka zeby do zmiennej typu string zapisac n zmiennych typu integer oddzielonych spacjami

0

Gdy zostawiam zwykle przymisanie

char * dane
dane = _tokens.at(1).c_str()

kompilator burzy sie o neizgodnosc typow

invalid conversion from const char*' to char*'
daltego takie dziwne zabiegi

ktos moze pomoc?

pilne

0

oczywiscie okazalo sie ze odpowiedz jest banalnie prosta tylko ja sie zapetlilem
oto rozwiazanie

char * dane
dane = (char *)_tokens.at(1).c_str()
0

NTF -> newbie
Ta...

const char *dane;

Ma być wskaźnik do stałej, bo c_str() zwraca wskaźnik do stałej. Chyba nie chcesz modyfikować na chama pamięci w stringu? :)

0

Może nie taki Newbie ale jak sie przez cały czas siedzi w Delphi i trzeba sie na C++ przestawić bo prowadzący se ubzdurał akurat w tym języku program to trzeba zrobić :(
Na razie w C++ mam największe problemy właśne z konwersją typów i nie do końca czaję sytem w C panujący ale jestem na jak najlepszej drwodze buy go pojąć :)
Poniżej wrzucam cały kod programu, może uda Ci się pomóc w problemie - o soo chodzi jest wyjaśnione w części - INFO DLA DIETERA. Z góry dzięki za uwagi co do kodu.
A pytanie o rzutowanie dotyczyło się właśnie tego fragmentu poniżej INFO DLA DIETERA (tego w pseude kodzie).

/****************************************/
/* Autor:                               */
/*        Tomasz Suchanek               */
/*   nr albumu: 118291                  */
/* Wspólpraca:                          */
/*        Leszek Baraniewicz            */
/*        Eryk Pohl                     */
/*                                      */
/*  Rok: IV, AIR, ARR                   */
/*                                      */
/*  Prowadzący:                         */
/*       dr Ignacy Dulęba               */
/****************************************/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <string>

#define INPUT_FILE "input.dat"
#define OUT_FILE "output.poly"
#define LOG_FILE "log.txt"
#define _X 600
#define _Y 500
#define _OFF 0.001
#define _XOFF 1000
#define _YOFF 1000

using namespace std;


class Converter {
 	//class converting input data from  INPUT_FILE 
	//written in a specialized format into *.POLY file format
	//which describe node and edges Tree with segmentation and holes
	/*Guidelines
  	(*)workspace's dimmension 600x500
  	(*)point zero in left, bottom corner
      
	/*****************************************************************************
	*.POLY type - description
	#  First line: <# of vertices> <dimension (must be 2)>  <# of attributes> <# of boundary markers (0 or 1)>
	# Following lines: <vertex #> <x> <y> [attributes] [boundary marker]
	# One line: <# of segments> <# of boundary markers (0 or 1)>
	# Following lines: <segment #> <endpoint> <endpoint> [boundary marker]
	# One line: <# of holes>
	# Following lines: <hole #> <x> <y>
	# Optional line: <# of regional attributes and/or area constraints>
	# Optional following lines: <region #> <x> <y> <attribute> <maximum area>
	******************************************************************************/
	
	private:
		int _vertices;		//how many wertices we have already setted/loaded
		int _currSegNum;	//how many segments we have already setted/loaded
		int _currFigNum;	//how many figures we already have
		int _currHolNum;	//how many holes we already have
		char* _currLine;	//current readed line form INPUT_FILE
		char* _vertexList[32767];	//list of vertex
		char* _segmentList[32767];//list of all segments
		char* _holesList[32767];	//lsit of all holes
  	
  public:
	// + is implemented yet, - not implemented yet, = is part implemented
	 
		/**************************************/
		/* methods increasing counters				*/		
		/**************************************/   	 
		void AddVertNum(int Num);	//add number of veritices into current value 	+
		void incVert();		//increase by 1 current vertex numbers							+
		int GetVertNum();	//return current veritices number										+
		void IncFigNum();	//increase by 1 current figure numbers							+
		int GetFigNum();	//returns current figure numbers    								+
		void IncHolNum();	//increase by 1 current hole numbers								+
		int GetHolNum();	//returns current hole numbers        							+
		void IncSegNum();	//increase by 1 current segmentnumbers							+
		int GetSegNum();	//returns current segment numbers        						+    
		void AddSegNum(int Num);	//add numer of added segments into current value	  +
		void ShowLine();	//shows what is already in _currLine								+
		char* GetLine();	//returns current line  															+
		void SetLine(char *Str);	//add read value
      
		/**************************************/
		/* methods writing into output file		*/		
		/**************************************/       
    
    int SaveToFile();	//save data into file specified by OUT_FILE					+
    int WriteHeader();//write into file specified by OUT_FILE							+
    int WriteSegments();//write info OUT_FILE segments										+
    int WriteSegHeader();//write header info about segments into OUT_FILE	+
    int WriteVert();	//write vertices into file OUT_FILE									+
    int WriteHolHeader();//write into OUT_FILE number of holes						+
    int WriteHoles();	//write into OUT_FILE holes list										+
    		
		/**************************************/
		/* methods adding elements into lists	*/		
		/**************************************/		
    void AddScene();	//add to list scene point + holes at end of list		+   		
		void AddRectangle(char*);	//add rectangle to all lists								-
		void AddCurve(char*);			//add curve to all lists										-
		void AddInterval(char*);	//add intervals to all lists								-

		
		/**************************************/
		/* all other functions								*/		
		/**************************************/		
		
    int ReadLine();				//read one complete line from INPUT_FILE				-
		int CheckIsCorrect();	//check that loaded already line is correct			=
													// if is then return 1
													// if is a comment then return 0
													// returns 2 when is not supported 
													// but implemented function like BEZIER
													// if not then result-1
		void SetDefault();		//resets all fields in class										+
		
		};		

vector<string> SplitIntoWords(const string& Str) {
  vector<string> Result;
  int SpacePos = -1;
  int OldPos = 0;
  while ((SpacePos = Str.find(" ", SpacePos + 1)) != string::npos) {
     Result.push_back(Str.substr(OldPos, SpacePos - OldPos));
     OldPos = SpacePos;
  }
  Result.push_back(Str.substr(OldPos, string::npos));
  return Result;
}


//set defaults value 		
void Converter::SetDefault() {
  _vertices = 0;
	_currFigNum = 0;
	_currHolNum = 0;
	_currLine = "PROSTOKAT 10 20 30 40 c\0";	
}

void Converter::ShowLine() {
       fprintf(stdout,_currLine);
}

char* Converter::GetLine() {
  return _currLine;
}

void Converter::SetLine(char *Str) {
	_currLine = Str;
}


//add number of veritices into current value	
void Converter::AddVertNum(int Num) {
  _vertices += Num;
}

void Converter:: incVert() {
  _vertices =+ 1;
}

int Converter::GetVertNum() {
	return _vertices;
};

void Converter::IncFigNum() {
	_currFigNum += 1;
}

int Converter::GetFigNum() {
	return _currFigNum;
}

void Converter::IncHolNum() {
	_currHolNum += 1;
}

int Converter::GetHolNum() {
	return _currHolNum;
}


void Converter::AddSegNum(int Num) {
	_currSegNum += Num;
}

void Converter::IncSegNum() {
	_currSegNum += 1;		 				 				 
}

int Converter::GetSegNum() {
	return _currSegNum;
}

int Converter::CheckIsCorrect() {
	vector<string> _tokens;
	_tokens = SplitIntoWords(_currLine);
  string test;
  printf("%s",_currLine);
//  printf("%s\n",_tokens.at(1).c_str());
	if (strncmp(_currLine,"PROSTOKAT",9) == 0) {
//adding to vertex list
	//_tokens looks like: FIGURE x, y, w, h COLOR

/*****************************INFO DLA DIETERA ***********************************************/
/*
    jak widac mam tablice _vertex[] w ktorej chce umiescic w liniach to co bede zapisywal do pliku
    i teraz musze tam umiescic to co sie znajduje w _tokens (tablicy wektorow) string
    w zaleznoisci od tego jaki byl poczatek wczytanego stringa do zmiennej _currLine
    tutaj masz ponizej przypadek dla poczatku stringu PROSTOKAT
    wejsciowy string ma taka postac:
    _currLine: PROSTOKAT 5 5 100 50 r
    i jest on pociety do _tokens nastepujaco (wzlgędem spacji):
    _tokens.at(0) = PROSTOKAT
    _tokens.at(1) = 5
    _tokens.at(2) = 5
    _tokens.at(3) = 100
    _tokens.at(4) = 50
    _tokens.at(5) = r
    potrzebne mi sa z tego tylko elementy 1-4, ktore teraz musze odpowiednio zapisac w liniach
    ponizej masz zapisane w postaci PSEUDO KODU takiej postaci
    	_vertexList[GetVertNum()+1] = "%d %d %d %d",GetVertNum()+1,atoi(_tokens.at(1).c_str()),atoi(_tokens.at(2).c_str()),GetFigNum()+1;
    	_vertexList[GetVertNum()+2] = "%d %d %d %d",GetVertNum()+2,atoi(_tokens.at(1).c_str()),atoi(_tokens.at(2).c_str())+atoi(_tokens.at(4).c_str()),GetFigNum()+1;
	    _vertexList[GetVertNum()+3] = "%d %d %d %d",GetVertNum()+3,atoi(_tokens.at(1).c_str())+atoi(_tokens.at(3).c_str()),atoi(_tokens.at(2).c_str())+atoi(_tokens.at(4).c_str()),GetFigNum()+1;
  	  _vertexList[GetVertNum()+4] = "%d %d %d %d",GetVertNum()+4,atoi(_tokens.at(1).c_str())+atoi(_tokens.at(3).c_str()),atoi(_tokens.at(2).c_str()),GetFigNum()+1;
		co i jak musze przypisac - zrobilem to tak jakby to byla funkcja printf zebys zobaczyl idee o co mi chodzi
	 	problem tkwi w konwersji typów
	 	_tokens.at(xxx) jest typu const char*
	 	_vertexList[zzz] jest typu char
	 	zrzutowanie _tokens.at(xxx) na typ (char *) nie pomaga bo nie mozna uzyc operatora + (o to sie juz ciebie dzis pytalem)
	 	a cos takiego kompiluje sie ale nie chce dzialac poprawnie, tzn EXE sie sypie a j nie wiem czemu
			strcat(_vertexList[GetVertNum()+1],(char *)(GetVertNum()+1));
  		strcat(_vertexList[GetVertNum()+1],_tokens.at(1).c_str());
    	strcat(_vertexList[GetVertNum()+1],_tokens.at(2).c_str());
    	strcat(_vertexList[GetVertNum()+1],(char *)(GetFigNum()+1));	 	  	 	 
		mam nadzieje ze wyjasnilem wystarczajaco jasno o co mnie chodzi
		z gory dzieki iza pomoc
*/
/******************************KONIEC INFO****************************************************/
//adding verticies 
  	_vertexList[GetVertNum()+1] = "%d %d %d %d",GetVertNum()+1,atoi(_tokens.at(1).c_str()),atoi(_tokens.at(2).c_str()),GetFigNum()+1;
  	_vertexList[GetVertNum()+2] = "%d %d %d %d",GetVertNum()+2,atoi(_tokens.at(1).c_str()),atoi(_tokens.at(2).c_str())+atoi(_tokens.at(4).c_str()),GetFigNum()+1;
	  _vertexList[GetVertNum()+3] = "%d %d %d %d",GetVertNum()+3,atoi(_tokens.at(1).c_str())+atoi(_tokens.at(3).c_str()),atoi(_tokens.at(2).c_str())+atoi(_tokens.at(4).c_str()),GetFigNum()+1;
	  _vertexList[GetVertNum()+4] = "%d %d %d %d",GetVertNum()+4,atoi(_tokens.at(1).c_str())+atoi(_tokens.at(3).c_str()),atoi(_tokens.at(2).c_str()),GetFigNum()+1;
//adding segments
		_segmentList[GetSegNum()+1] = "%d %d %d %d",GetSegNum()+1,GetVertNum()+1,GetVertNum()+2,GetFigNum()+1;
		_segmentList[GetSegNum()+2] = "%d %d %d %d",GetSegNum()+2,GetVertNum()+2,GetVertNum()+3,GetFigNum()+1;
		_segmentList[GetSegNum()+3] = "%d %d %d %d",GetSegNum()+3,GetVertNum()+3,GetVertNum()+4,GetFigNum()+1;  	
		_segmentList[GetSegNum()+4] = "%d %d %d %d",GetSegNum()+4,GetVertNum()+4,GetVertNum()+1,GetFigNum()+1;  				
//adding holes	
	   _holesList[GetHolNum()+1] = "%d %f %f", GetHolNum()+1,(atof( _tokens.at(1).c_str())+atof( _tokens.at(3).c_str()))/2,(atof( _tokens.at(2).c_str())+atof( _tokens.at(4).c_str()))/2;
//adding veriticies and segments number and hole number after all operation	
	  AddVertNum(10);	
		AddSegNum(10);
		IncHolNum();		    	
		return 1;
	}
	else if (strncmp(_currLine,"WIELOBOK",8)==0) {
		return 2;
	}
	else if (strncmp(_currLine,"LAMANA",6)==0) {
	  return 2;
	}
	else if (strncmp(_currLine,"ODCINEK",7)==0) {
//adding to vertex list	
	//_tokens looks like: FIGURE x, y, w, h COLOR
  	_vertexList[GetVertNum()+1] = "%d %d %d %d",GetVertNum()+1,_tokens.at(2),_tokens.at(3),GetFigNum()+1;		  
  	_vertexList[GetVertNum()+1] = "%d %d %d %d",GetVertNum()+1,_tokens.at(4),_tokens.at(5),GetFigNum()+1;		    	
//adding segments
		_segmentList[GetSegNum()+1] = "%d %d %d %d",GetSegNum()+1,GetVertNum()+1,GetVertNum()+2,GetFigNum()+1;  	
		_segmentList[GetSegNum()+2] = "%d %d %d %d",GetSegNum()+2,GetVertNum()+2,GetVertNum()+1,GetFigNum()+1;  	
//adding veriticies and segments number and hole number after all operation	
	  AddVertNum(2);	
		AddSegNum(2);;		
	  return 1;
	}	  
	else if (strncmp(_currLine,"TEKST",5)==0) {
	  return 2;
	}
	else if (strncmp(_currLine,"OKRAG",5)==0) {
	  return 2;
	}	  
	else if (strncmp(_currLine,"KOLO",4)==0) {
	  return 2;
	}	  
	else if (strncmp(_currLine,"LUK",3)==0) {
	  return 2;
	}	  
	else if (strncmp(_currLine,"CZYSC",5)==0) {
	  return 2;
	}	  
	else if (strncmp(_currLine,"CZEKAJ",6)==0) {
	  return 2;
	}	  
	else if (strncmp(_currLine,"STATUS",6)==0) {
	  return 2;
	}	    	  	 		
	else return -1;
}

int Converter::WriteHeader() {
	FILE *fp;	//file pointer
	//checking if file exists
	if ((fp=fopen(OUT_FILE,"a"))==NULL)
	{
 		fprintf(stderr,"Can't find file %s", OUT_FILE);
		exit(1);
	}
	else
	{
		fprintf(fp,"Header");
		fprintf(fp,"%d 2 0 1\n",GetVertNum());
		return 1;
	}
	if(fclose(fp) != 0)	
		fprintf(stderr,("Error while closing input file"));
}

int Converter::WriteSegHeader() {
	FILE *fp;	//file pointer
//checking if file exists
	if ((fp=fopen(OUT_FILE,"a"))==NULL)
	{
		fprintf(stderr,"Can't find file %s", OUT_FILE);
		exit(1);
	}
	else
	{
  	fprintf(fp,"SegHeader");  		
		fprintf(fp,"%d 1\n",GetSegNum());
		return 1;
	}		
	if(fclose(fp) != 0)	
		fprintf(stderr,("Error while closing input file"));
}

int Converter::WriteHolHeader() {
	FILE *fp;	//file pointer
	//checking if file exists
	if ((fp=fopen(OUT_FILE,"a"))==NULL)
	{
		fprintf(stderr,"Can't find file %s", OUT_FILE);
		exit(1);
	}
	else
	{
  	fprintf(fp,"HoleHeader");  		
		fprintf(fp,"%d\n",GetHolNum());
		return 1;
	}		
	if(fclose(fp) != 0)	
		fprintf(stderr,("Error while closing input file"));	
}

int Converter::WriteHoles() {
	int i;
	FILE *fp;	//file pointer
	//checking if file exists
	if ((fp=fopen(OUT_FILE,"a"))==NULL)
	{
		fprintf(stderr,"Can't find file %s", OUT_FILE);
		exit(1);
	}
	else
	{
  	fprintf(fp,"Holes");  		
		for(i=0;i<GetHolNum();i++){
	  	fprintf(fp,"%s\n",_holesList[i]);
  	}
		return 1;
	}				
	if(fclose(fp) != 0)	
		fprintf(stderr,("Error while closing input file"));
}

int Converter::WriteVert() {
	int i;
	FILE *fp;	//file pointer
	//checking if file exists
	if ((fp=fopen(OUT_FILE,"a"))==NULL)
	{
		fprintf(stderr,"Can't find file %s", OUT_FILE);
		exit(1);
	}
	else
	{
  	fprintf(fp,"Verticies");  		
		for(i=0;i<GetVertNum();i++){
	  	fprintf(fp,"%s\n",_vertexList[i]);
		}
		return 1;
	}
	if(fclose(fp) != 0)	
		fprintf(stderr,("Error while closing input file"));				
}

int Converter::WriteSegments() {
	int i;
	FILE *fp;	//file pointer
	//checking if file exists
	if ((fp=fopen(OUT_FILE,"a"))==NULL)
	{
		fprintf(stderr,"Can't find file %s", OUT_FILE);
		exit(1);
	}
	else
	{
  	fprintf(fp,"Segments");  		
		for(i=0;i<GetSegNum();i++){
		  fprintf(fp,"%s\n",_segmentList[i]);
  	} 	
	return 1;
	}				
	if(fclose(fp) != 0)	
		fprintf(stderr,("Error while closing input file"));	
}

int Converter::SaveToFile() {
	WriteHeader();
	WriteVert();
	WriteSegHeader();
	WriteSegments();
	WriteHolHeader();
	WriteHoles();
	return 1;
}

void Converter::AddScene() {
/* DO POPRAWKI - ZAPISANE NA RAZIE W FORMIE PSEUDO KODU!*/	
//adding to vertex list
  _vertexList[GetVertNum()+1] = "%d %d %d %d",GetVertNum()+1,0,0,GetFigNum()+1;
  _vertexList[GetVertNum()+2] = "%d %d %d %d",GetVertNum()+2,0,_Y,GetFigNum()+1;  
  _vertexList[GetVertNum()+3] = "%d %d %d %d",GetVertNum()+3,_X,_Y,GetFigNum()+1;  
  _vertexList[GetVertNum()+4] = "%d %d %d %d",GetVertNum()+4,_X,0,GetFigNum()+1;  
  _vertexList[GetVertNum()+5] = "%d %f %d %d",GetVertNum()+5,_OFF,0,GetFigNum()+1;  
  _vertexList[GetVertNum()+6] = "%d %f %d %d",GetVertNum()+6,-_XOFF+_OFF,-_YOFF,GetFigNum()+1;  
  _vertexList[GetVertNum()+7] = "%d %d %d %d",GetVertNum()+7,_XOFF,-_YOFF,GetFigNum()+1;  
  _vertexList[GetVertNum()+8] = "%d %d %d %d",GetVertNum()+8,_XOFF,_YOFF,GetFigNum()+1;  
  _vertexList[GetVertNum()+9] = "%d %d %d %d",GetVertNum()+9,-_XOFF,_YOFF,GetFigNum()+1;  
  _vertexList[GetVertNum()+10] = "%d %d %d %d",GetVertNum()+10,-_XOFF,-_YOFF,GetFigNum()+1;  							  
//adding segments
	_segmentList[GetSegNum()+1] = "%d %d %d %d",GetSegNum()+1,GetVertNum()+1,GetVertNum()+2,GetFigNum()+1;
	_segmentList[GetSegNum()+2] = "%d %d %d %d",GetSegNum()+2,GetVertNum()+2,GetVertNum()+3,GetFigNum()+1;
	_segmentList[GetSegNum()+3] = "%d %d %d %d",GetSegNum()+3,GetVertNum()+3,GetVertNum()+4,GetFigNum()+1;
	_segmentList[GetSegNum()+4] = "%d %d %d %d",GetSegNum()+4,GetVertNum()+4,GetVertNum()+5,GetFigNum()+1;
	_segmentList[GetSegNum()+5] = "%d %d %d %d",GetSegNum()+5,GetVertNum()+5,GetVertNum()+6,GetFigNum()+1;				
	_segmentList[GetSegNum()+6] = "%d %d %d %d",GetSegNum()+6,GetVertNum()+6,GetVertNum()+7,GetFigNum()+1;
	_segmentList[GetSegNum()+7] = "%d %d %d %d",GetSegNum()+7,GetVertNum()+7,GetVertNum()+8,GetFigNum()+1;
	_segmentList[GetSegNum()+8] = "%d %d %d %d",GetSegNum()+8,GetVertNum()+8,GetVertNum()+9,GetFigNum()+1;
	_segmentList[GetSegNum()+9] = "%d %d %d %d",GetSegNum()+9,GetVertNum()+9,GetVertNum()+10,GetFigNum()+1;
	_segmentList[GetSegNum()+10] = "%d %d %d %d",GetSegNum()+10,GetVertNum()+10,GetVertNum()+1,GetFigNum()+1;	
//adding holes	
	_holesList[GetHolNum()+1] = "%d -1 -1", GetHolNum()+1;
//adding veriticies and segments number and hole number after all operation	
	AddVertNum(10);	
	AddSegNum(10);
	IncHolNum();		    
}

void Converter::AddInterval(char *) {		 
}

void Converter::AddCurve(char*) {
}

void Converter::AddRectangle(char*) {
}
		 

int main() {
	FILE *fp;				//file pointer to input file
	char row[512];			//temporary variable for reading input lines form file
	Converter test;	//data		
	
//set default settings	
	test.SetDefault();
	
//checking if file exists
	if((fp=fopen(INPUT_FILE,"r"))==NULL) {
		fprintf(stderr,"Can't find iput file");
		exit(2);
	}
	else {
	//reading whit checkin if file is empty or is end of file
		while (!feof(fp)) {
			fgets(row,512,fp);
			test.SetLine(row);
			test.CheckIsCorrect();
		}
    test.AddScene();
		test.SaveToFile();
	//closing file with checking errors			
		if(fclose(fp) != 0)	
			fprintf(stderr,("Error while closing input file"));
		}

	test.CheckIsCorrect();
  return 0;
	}

P.S. ale znacznik cpp tutaj dziwnie formatuje :(

0

Masz zdrowie chłopie do pisania takiego kodu...
Te wszystkie otwierania i zamykania pliku przed zapisaniem kawałka danych do pliku po rostu rozwala...
A ten fragment, hmmm może tak bardziej logicznie programuj, coś w stylu:

int Converter::CheckIsCorrect()
{
    vector<string> _tokens;
    _tokens = SplitIntoWords(_currLine);
    
    int x,y,w,h;
    if ( _tokens[0]=="PROSTOKAT" )
    {
        // to tez mozna przerzucic do metody
        x = atoi( _tokens[1].c_str() );
        y = atoi( _tokens[2].c_str() );
        w = atoi( _tokens[3].c_str() );
        h = atoi( _tokens[4].c_str() );
        
        int v1,v2;
        v1 = AddVertex( x, y );
        v2 = AddVertex( x+w,y+h );
        //...
        
        AddSegment(v1,v2);
        //...
    }
    else if ( _tokens[0]=="" )
    {
    }
//....

Dodaj metody AddVertex(), AddSegment i co tam jeszcze potrzebujesz.

0

Spoko chcialem sobie to pogrupowac w metody, mi bardziej chodzilo o to zxeby mi popomagac w konwersjach, bo z tym w C na azie mam najwiekszy problem.
Co do takiego zapisywania to ono ma powod, poniewaz docelowo potem prorgram ma tez generowac pliki bedace typami *.node *.ele *.edge, ktore sa fragmentami poly (ale to ma byc jako opcja). Dlaczego uuu dlugo by wyjasniac. Jesli jednak Cie to zainteresoalo to odsylam tutaj http://www-2.cs.cmu.edu/~quake/triangle.html. Problem dotyczy diagramu voronoi. Jest juz gotowa aplikacja napisana przez madre glowy i nalezy do niej przystosowac dane z pewnego programu. Podem odpalic program znajdujacy sie w linku z odpowiednimi opcjami a potem wynik znow skonwertowac do formatu tego pierwszego programu (takie sa zalozenia projektu i niestety nie mnie je zminiac). Niestety z uwagi ze termin zaliczenia sie niuchronnie zbliza niestety kod nie bedzie ani efektywny ani bezbledny - ma dzialac (chociaz nie jestem zwolennikiem takiego stylu pisania programow).
Najgorse jest to ze juz to napisalem w zeszlym semestre pod Delphi, ale niestety tutaj to ma byc w C++, bo ma by niezalezne od platformy.
Dzieki za uwagi.
Poizdroofka

0

moze sprintf(...) pomoze?

0

pomogło :)

1 użytkowników online, w tym zalogowanych: 0, gości: 1