How to change all words at once?

Hi guys. So when I click on a word in Code Blocks, it highlights all of the same words. Now, how do I change all of those words at once? For example

1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
int sub(int x, int y)
{
    return x-y;
}
int main()
{
std::cout<<"What is 7 - 6\n";

std::cout<< sub(5,6);
return 0;
}


So I double clicked "int". It highlights all of the ints. I want to change all of the ints to floats simultaneously. Can I do this? If not, can I do something similar?
Ctrl+H is usually Find+Replace. Just do a replace all.

EDIT: note that you'll want to be careful with that. You probably don't want to replace all.

For example, you don't want main to return a float. And if you have a variable named "breathmint" you don't want it changed to "breathmfloat"
Last edited on
In the menu ’Settings’ /’Editor’ /’Margins und Caret’ the ’Multiple Selection’ can be activated. While holding the Ctrl-key the user can select different lines in the active editor via the left mouse button. The selections will be appended in the clipboard via the shortcut Ctrl-C or Ctrl-X. Ctrl-V will insert the content at the current cursor position. An additional option called ’Enable typing (and deleting)’ can be activated for multiple selections. This feature is useful if you want to add a pre-processor directive like #ifdef at different source lines or if you want to overwrite or replace a text at several positions.
Thank you, Disch :D Oh, and thanks for the warning, that's true.
Thanks Eric. Eric, I tried that, but I still dont get how to do it?? Hm. I tried clt H but it just does this "goto line" thing.
I kept trying it, but it doesn't seem to work?? I have it all marked as you said. So, say, I double clicked int now. How do i replace all int? Before I double click it do I gold down CTRL + H? or CTRL + x? Like, how do i do this?
Okay guys, I've found the answer if anyone else was interested. It's actually CTRL + R.
Ctrl+H is pretty standard but I suppose it does vary in different editors.

Glad you figured it out.
Thanks Disch for your help :D. Yeah, I'll remember that CTRL H is standard. Yeah I'm glad I found it too hehe
Topic archived. No new replies allowed.