Skip to content
Snippets Groups Projects
Commit ad6994dc authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

use ostringstream and not char[256]

parent 8ce5acf7
No related branches found
No related tags found
No related merge requests found
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sstream>
#include "dgSystemOfEquations.h" #include "dgSystemOfEquations.h"
#include "function.h" #include "function.h"
#include "MElement.h" #include "MElement.h"
...@@ -174,9 +175,9 @@ void dgSystemOfEquations::export_solution_as_is (const std::string &name){ ...@@ -174,9 +175,9 @@ void dgSystemOfEquations::export_solution_as_is (const std::string &name){
// the elementnodedata::export does not work !! // the elementnodedata::export does not work !!
for (int ICOMP = 0; ICOMP<_claw->nbFields();++ICOMP){ for (int ICOMP = 0; ICOMP<_claw->nbFields();++ICOMP){
char aaa[245]; std::ostringstream name_oss;
sprintf(aaa,"%s_COMP_%d.msh",name.c_str(),ICOMP); name_oss<<name<<"_COMP_"<<ICOMP<<".msh";
FILE *f = fopen (aaa,"w"); FILE *f = fopen (name_oss.str().c_str(),"w");
int COUNT = 0; int COUNT = 0;
for (int i=0;i < _elementGroups.size() ;i++){ for (int i=0;i < _elementGroups.size() ;i++){
COUNT += _elementGroups[i]->getNbElements(); COUNT += _elementGroups[i]->getNbElements();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment