tags:

views:

59

answers:

1

Hello everyone,

I am using MacBook Pro Mac OS 10.5 with related version of XCode. I am new to this development environment. I am developing C++ console/terminal applications (File->New project, then from the list on the left "Command line utility", and on the right "C++ tool".).

For C++ source code file, I want to print source file content with line number. Any ideas how to do this?

thanks in advance, George

+1  A: 

I found this article A Recipe to Pretty-Print Your iPhone Source in Xcode it uses enscript which is installed by Apple for Xcode on Snow Leopard so no need for macports etc.

You can get linenumbers by passing -C as an argument to the enscript executable called in the shell script

Mark
I am using Mac OS 10.5, and I think it should be called "Leopard", other than "Snow Leopard"? Does this method also works for me?
George2
In general yes - the only difference might be that enscript is not installed bu Apple if it is it is /usr/bin/enscript - if not then you need to install it either directly compiling or via macports, fink etc
Mark
Thanks, question answered!
George2