Блог пользователя Monkey_D_Luffy_1999

Автор Monkey_D_Luffy_1999, 8 лет назад, По-английски

Hi everyone! Could you help me to find where can I make a default source and open it in Codeblocks? Thanks.

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится +12 Проголосовать: не нравится

Go to Settings -> Editor -> Default Code and enter the source you want.

»
8 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

It doesn't work for main.cpp file, when you're creating new project. Only for new file in the existing project.

»
8 лет назад, # |
  Проголосовать: нравится +2 Проголосовать: не нравится

If you want to change default code of main.cpp when you create new project in CodeBlocks then here is my way (I tested on Windows):
- Go to Program Files/CodeBlocks/share/CodeBlocks/templates/wizard/console/cpp.
- You'll see file main.cpp, what you need is just edit content of this file to your default code.
Hope this will help you!

  • »
    »
    7 лет назад, # ^ |
    Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

    i did it but when i am creating a new file with CTRL+SHIFT+N , it happens to be blank file

    • »
      »
      »
      7 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      You can use code abbreviation. Go to codeblocks->setting -> Abbreviation. Then create a new keyword and paste your default code and save it. Then every time you open a new file .....save it. Then write the keyword you created.then press ctrl+j. Your default code will appear... ;D

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    It says that I don't have permission from owner to change it.

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      (on windows 10) right click on the file then select properties -> security -> Edit -> Add -> type the username in the box and click on check names. then click OK -> Apply and then you can close the windows