I have a problem with the editing style again, any ideas?

What does that mean?
It unclear what are you asking.
what is the question?
Please ask your teacher what is wrong with it.
My teacher said thay my code is good but the style doesnt have the correct style

Then presumably your teacher has told you what the style s/he wants is?

Please stop spamming the forum with these threads. There's no point creating thread after thread after thread for this.
To apply good coding style follow the guidelines from bellow link, and apply it to your code:
http://geosoft.no/development/cppstyle.html

Don't skip anythings from the link, that includes also commenting your code etc..
If you teacher still after that tells you its wrong, just give him a link and tell him you were following the coding style most modern C++ code follows.

and then tell him you're right and he is wrong. and let him tell you what he actually wants.
Last edited on
It sounds like the prof wants a particular coding style. Ask him/her what that style is. Consider tools like astyle or GNU indent to automatically reformat your code into the desired style. The first thing I do when debugging code from this forum is reformat it using "indent" into the style that I'm accustomed to.

In fact, I'd argue that the prof should do the same: if he/she doesn't like the format then he should reformat to his liking, not you. Here in the real world, that's what I'd tell anyone who didn't like my coding style.

Nothing gets a flame war going like debates on coding style. It all boils down to a few things:
- The style is designed to make the code readable and maintainable.
- Be consistent
- Comment your code
- The indentation should reflect the actual block structure.

Your style is fine except perhaps for the 4th point. For example, I think this:
1
2
3
4
5
  if(argc >= 4){
    pivote = std::stoi(argv[3]);
    }else{
      std::cout << "El pivote toma el valor 0." << std::endl;
      }      

should be like this:
1
2
3
4
5
  if(argc >= 4){
    pivote = std::stoi(argv[3]);
  }else{
    std::cout << "El pivote toma el valor 0." << std::endl;
    }

or, if you want to keep the brace lined up with the code, perhaps:
1
2
3
4
5
6
  if(argc >= 4){
    pivote = std::stoi(argv[3]);
    }
  else{
    std::cout << "El pivote toma el valor 0." << std::endl;
    }
The point is that the code under the if and the code under the else should be indented to the same level.
Topic archived. No new replies allowed.