Author Topic: How to change the default code?  (Read 8507 times)

Offline GabrielNoob

  • Single posting newcomer
  • *
  • Posts: 4
How to change the default code?
« on: November 16, 2016, 12:23:43 am »

https://s16.postimg.org/iafq4r0xh/Sem_t_tulo.png
I would like to customize the initial code in CodeBlock
thanks

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How to change the default code?
« Reply #1 on: November 16, 2016, 09:09:42 am »
This is part of the wizard and its files. You can modify them. Or even create a template project.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline rlb

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: How to change the default code?
« Reply #2 on: November 21, 2016, 11:10:28 am »
To be precise, if you right-click on the project wizard itself, you can modify what the wizard does; but if you want to modify the file itself, AFAICT that can't be done through the IDE, you'll have to edit the template file by hand. Luckily that's not difficult, though you may have to edit the file in administrator mode if you're on Windows. I don't know whether they're write-protected on Linux or other systems as well, but you'll know how to override that if necessary.
The file in question (if you've chosen the same wizard I did; if not, it's easily findable from there) is <codeblocks home>/share/CodeBlocks/templates/wizard/console/cpp/main.cpp.
If there's a way to edit it from the IDE, I'd like to know; but if not, you can at least do it by hand.
Richard Bos

Offline GabrielNoob

  • Single posting newcomer
  • *
  • Posts: 4
Re: How to change the default code?
« Reply #3 on: November 25, 2016, 08:03:00 pm »
thanks rlb, worked correctly :D