Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

JBot

macrumors 6502
Original poster
Jan 9, 2006
271
1
Calgary.Alberta.Canada
To comment a selected portion of your code, where do you go?
Very basic question, i know you can do it with other editors, i just dont know where that option is on Xcode.
Im writing in c++ if that matters.
 

slooksterPSV

macrumors 68040
Apr 17, 2004
3,544
306
Nowheresville
To comment a selected portion of your code, where do you go?
Very basic question, i know you can do it with other editors, i just dont know where that option is on Xcode.
Im writing in c++ if that matters.

you can use the // for single lines and /* */ for multiple lines.
So if I had the code
PHP:
#include <iostream>

int main()
{
//my program code goes here
std::cout << "Hello world";
/* I can have multiple paragraphs here
as well see */
return 0;
}
 

JBot

macrumors 6502
Original poster
Jan 9, 2006
271
1
Calgary.Alberta.Canada
I know how to use that, but im wondering if there is a way for me to just highlight certain lines and go to the 'comment' button, and that will place the // infront of each individual line.
Emacs has that capability, i would hope Xcode does also...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.