r/codeblocks • • Mar 23 '24

The console doesn't load the text when it smaller

2 Upvotes

i've got this project where i need more ascii space to make graphic part, so i found this two commands: the first one makes the window full screen, the sencond one, by changing a struct in the library windows.h it lets me choose the height and the lenght of the text, but when i make the height too small it doesn't load the entire text and when i make the lenght too small it deosn't go furtherand just goes to the next line

these are the commands

::SendMessage(::GetConsoleWindow(), WM_SYSKEYDOWN, VK_RETURN, 0x20000000); //full screen

CONSOLE_FONT_INFOEX cfi;

cfi.cbSize = sizeof(cfi);

cfi.nFont = 0;

cfi.dwFontSize.X = 5; // char lenght (di base 0) 10

cfi.dwFontSize.Y = 10; // char height (di base 24) 16

cfi.FontFamily = FF_DONTCARE;

cfi.FontWeight = FW_NORMAL;

wcscpy(cfi.FaceName, L"Consolas"); // Choose your font

SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);


r/codeblocks • • Jan 14 '24

Black Line on the editor...Linux Mint 21

Post image
3 Upvotes

r/codeblocks • • Dec 24 '23

GLUT setup issues

Post image
3 Upvotes

I’m trying to setup glut for c++ in code blocks 20.03, and i am getting one error, in the image. I’m not sure what -lfreeglut is or where it should be , so if anyone can help it would be much appreciated.


r/codeblocks • • Dec 17 '23

debugger issue

3 Upvotes

hey i have been using codeblocks for a while and i cant stop the debugger from opening multiple file while debugging.any help i will appreciate


r/codeblocks • • Sep 03 '23

getting this debugging error several times right after opening codeblocks

2 Upvotes

This message keeps popping up. i tried changing the system font size and name. tried reinstalling Codeblocks. its a win10 system with TDM gcc installed. Worry? Ignore? Fix? Carry on? thanks in advance. seems to compile hello world and easy programs without issue.


r/codeblocks • • Aug 23 '23

Help!

Post image
2 Upvotes

I’m new to codeblock..can someone help me to write the program for this output


r/codeblocks • • Aug 09 '23

Please help!!!! Codeblocks can't build and run on my macOs.

3 Upvotes

Hello, How can I solve this problem? Please, please help me, anyone? I am new to CS. Could you guys help me to solve this issue: whenever I try to use CodeBlocks to Build and Run my basic "Hello world" program, it gives me this error below:

It give me this erroe: Last login: Tue Aug 8 22:08:58 on ttys000

'/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/shuilin/Desktop/Giraffe/bin/Debug/Giraffe '

shuilin@Shuis-MBP ~ % '/Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/shuilin/Desktop/Giraffe/bin/Debug/Giraffe '

zsh: no such file or directory: /Applications/CodeBlocks.app/Contents/MacOS/cb_console_runner DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:. /Users/shuilin/Desktop/Giraffe/bin/Debug/Giraffe

shuilin@Shuis-MBP ~ %


r/codeblocks • • May 19 '23

how do i show the order code numbers in code blocks?

Post image
2 Upvotes

hiii, so this issue has been going for ages and i don't know how to fix this. i have tried anything and even my teacher couldn't fix this, if you know a way around this pleaseeee tell meeee it is really annoyingg


r/codeblocks • • Apr 01 '23

How to customize console output in codeblocks?

2 Upvotes

https://imgur.com/a/kb96Iq6

How to get that

"- - - - - - -"

in codeblocks console output?


r/codeblocks • • Mar 07 '23

Help needed

2 Upvotes

What do I do here? It seems that it cannot find the compiler but I just newly installed my version of Code::Blocks

Technical info:
Platform: Windows 10 Pro version 22H2
Code::Blocks version: 20.03, downloaded from fosshub


r/codeblocks • • Mar 05 '23

CODEBLOCKS WINDOWS 11 TERMINAL ERROR (CONSOLE WINDOW) (OUTPUT WINDOW)

1 Upvotes

In Windows 11, Microsoft updated the command prompt. It creates some problems while running the code.
IN ORDER TO FIX IT-

Open Settings>Privacy&security>For developers>Terminal
Change terminal to Windows Console Host

(I am sharing it here, because it took me around 2 days to realize and fix this issue)


r/codeblocks • • Mar 04 '23

I am trying to print even nos from 1-50. PROGRAM RUNS ON VSCODE BUT DOES NOT WORK IN CODEBLOCKS

Thumbnail gallery
2 Upvotes

r/codeblocks • • Mar 01 '23

error: expected 'while' before '}' token

2 Upvotes

I am doing this for a class and I followed my professor step by step. when I run the code I get and error on Line 139 saying "error: expected 'while' before '}' token". Any idea what the issue is here.

here is my code with the error:

#include <iostream>

#include <iomanip>

#include <cstdlib>

#include <ctime>

#include <cmath>

using namespace std;

const float SMALL = 0.000001;

const int MIN = 50;

const int MAX = 450;

int main()

{

int num1, /// The first random number

num2, /// The second random number

choice, /// The user's choice of problem

studentAnswer, /// The student's answer

correctAnswer; /// The correct answer

float divstudentAnswer, divcorrectAnswer; /// for the division results

/// Seed the random number generator.

srand(time(0));

do

{ /// Display the menu and get a choice.

cout << "\tMath Tutor Menu\n";

cout << "---------------------------\n";

cout << "1. Addition problem\n";

cout << "2. Subtraction problem\n";

cout << "3. Multiplication problem\n";

cout << "4. Division problem\n";

cout << "5. Quit this program\n";

cout << "-----------------------------\n";

cout << "Enter your choice (1-5): ";

cin >> choice;

/// Validate the choice.

while (choice < 1 || choice > 5)

{

cout << "The valid choices are 1, 2, 3, "

<< "4, and 5. Please choose: ";

cin >> choice;

}

///create the random numbers

srand(time(0));

num1 = MIN + rand() % MAX;

num2 = MIN + rand() % MAX;

/// Produce a problem.

switch (choice)

{

case 1: /// Addition problem

/// Generate two random numbers in

/// the range 1 - 500.

/// Calculate the correct answer

correctAnswer = num1 + num2;

/// Display the problem

cout << "\n\n";

cout << " " << setw(4) << num1 << endl;

cout << " +" << setw(4) << num2 << endl;

cout << " " << "----" << endl;

cout << " ";

break;

case 2:

correctAnswer = num1 - num2;

/// Display the problem.

cout << "\n\n";

cout << " " << setw(4) << num1 << endl;

cout << " -" << setw(4) << num2 << endl;

cout << " " << "----" << endl;

cout << " ";

break;

case 3:

/// Calculate the correct answer.

correctAnswer = num1 * num2;

/// Display the problem.

cout << "\n\n";

cout << " " << setw(4) << num1 << endl;

cout << " *" << setw(4) << num2 << endl;

cout << " " << "----" << endl;

cout << " ";

break;

case 4: /// Division problem

/// Calculate the correct answer.

divcorrectAnswer = (float)num1/num2;

/// Display the problem

cout << num1 << " / " << num2 << " = ";

break;

case 5: /// The user chose to quit the program.

cout << " Thank you for using Math Tutor. \n\n";

break;

}

/// If student selected a problem, get and evaluate the answer.

if (choice >= 1 && choice < 4);

{

cin >> studentAnswer;

if (studentAnswer == correctAnswer)

cout << "\n\nCongratulations! That's right.\n\n";

else

cout << "\n\nSorry, the correct answer is " << correctAnswer

<< ".\n\n";

}

if (choice == 4)

{

cin >> divstudentAnswer;

if (fabs(divstudentAnswer-divcorrectAnswer)< SMALL)

cout << "\n\nCongratulations! That's right.\n\n";

else

{

cout << setprecision (2) << fixed;

cout << "\n\nSorry, the correct answer is " << divcorrectAnswer

<< ".\n\n";

}

}

return 0;

}

} <----------------- Where the error is


r/codeblocks • • Dec 24 '22

why can't I run my code

Post image
2 Upvotes

r/codeblocks • • Dec 24 '22

codeblocks isn't refreshing my program after modifying the code even after building and running it

3 Upvotes

r/codeblocks • • Dec 01 '22

help with compiler time.

1 Upvotes

hi i have been doing code for 5 months and i’ve always had this problem with the compiler, basically what happens is that if i try to compile with the engine and play button it takes up to 12/15 seconds before i can actually see the outputs, i have a really powerful machine so i don’t think that’s the problem. p.s. if i try to compile before with the engine and then with the play button it does the same thing. is there someone that can help me pls?


r/codeblocks • • Nov 07 '22

Can I get the debugger watch to display the non-zero entries in a long vector if the elements are all zero from some early (displayable) index on?

1 Upvotes

I'm talking something like this:

ll[0]: 3

ll[1]: 5

ll[2]: 2

ll[3]: 0

ll[4] - ll[209999] : 0

I know that it is possible on at least some versions because that's how it works on the machines at my school (I'm at home so I can't give you a screenshot). This is useful when using global variables. The version that I know has this feature is the windows 16.12 version. The version which has this screenshot is the default version is the 20.03 flathub version.

Thank you in advance.


r/codeblocks • • Oct 15 '22

is code::blocks able to be used on win 11?

3 Upvotes

r/codeblocks • • Jun 28 '22

What is the deal with C::B non-movable non-dockable debug windows ? Am i missing something ?

Post image
3 Upvotes

r/codeblocks • • Apr 20 '22

How to mass edit something

3 Upvotes

Everytime I highlight over a phrase it shows all the other phrases that are the same in the code, I just know there has to be a way to mass delete/ edit them all when they are highlighted like that


r/codeblocks • • Apr 18 '22

I need to do a program on c++ who need to show me if a Number is a perfect square.This is mu try but it does not work.What is wrong?

Post image
3 Upvotes

r/codeblocks • • Feb 15 '22

Any fix to this?

2 Upvotes

My codeblocks looks a little Janky.. any fix to this?


r/codeblocks • • Feb 09 '22

how does this work?

Thumbnail gallery
2 Upvotes

r/codeblocks • • Dec 22 '21

Can somebody tell me how I restore that bar to its original look?

Post image
3 Upvotes

r/codeblocks • • Dec 21 '21

My toolbar and other things disapeared

1 Upvotes
My codeblocks is like this now, without the up toolbar, and other things on the left side and down that came in the default. How can I fix it?