I have a question about creating a new line using the new line command in Xcode. The version of Xcode that I am using is 4.6.3. I am creating my current projects in OS X, under Application, the sub category Command Line Tool, and then I am doing it in the C programming language. I know that use use the printf command to execute the command. If is possible, I would like help on knowing how to do it. I will give a medal out to the person who can help me answer my question. Thanks if anyone can help, -Comm.Dan
A new line with printf? \n
Yes
is that the X11 that looks like a terminal? they've removed that under OSX Mountain Lion but new command line but you generally just install a new command line tools.
The escaped n is the newline in C\C++ ``` printf("\n"); ```
I have X11 on my Mac, but I don't use it Here is what I meant to say printf("/n'); or printf("\n");
K Thx I will see if ti works
Here is a reference for you: http://www.cplusplus.com/reference/cstdio/printf/
It doesn't work. All it does is show /n in the debugging console.
Not /n \n
I am writing my projects in C
The second one worked. Thanks for the help @e.mccormick, -Comm.Dan
@nincompoop What is X11 used for?
then you should've just asked how to add a new command line in C geez
there are two ways to create a command line: \n and std:endl
K Thx for the help @nincompoop -Comm.Dan
they are the same but with differing parameter requirement.
K
He said with printf, not cout.
k then \n LOL
Do you program @nincompoop and @e.mccormick?
I did C, C# and C++ a while back.
What languages are your favorites?
Professionally? No. Can I? Yes, some things. Know a bit of C++, Python, VBas, and HTML, used Perl and BASIC years ago, and am learning Java at the moment because it is required for my degree.
I am learning C and then am going on to Objective C.
I chose to learn C because I know that it is the basis for almost all of the modern programming languages.
yeh did those too. but I am not that proficient in Python, since it became popular when I've already stopped programming, and I am not a fan of Java for old time's sake.
It seems that most programmers end up regularly using 3 to 5 languages and most know 5. Some of these may be closely related, like C and C++, or somewhat related like either of those and Java. Usually it comes down to 1 or 2 that they work in for production, a script language, and others they have found useful.
Ok. Thanks so much for the help again both of you @e.mccormick and @nincompoop. Have a great rest of your night, -Comm.Dan
C to learn programming is not a great choice. C because you plan on doing OS development, drivers, etc. is a good choice. Why? Because C is not really that related to modern programming techniques. It is a bit distant from the features that newer languages have. It is still a wonderful language for being more directly tied to the machine code, but most coders do not want or need that.
Ok.
The three long term use and starting languages most universities use are C++, Java, and Python. They all display more modern techniques than C. C++ is best if you know you will be using C later. Java is best if you plan on working towards Android development. Python is best if you want to learn a scripting language right off that happens to also be used for much more. And there are several other reasons for each one. I just list those singular reasons as examples.
Ok
Join our real-time social learning platform and learn together with your friends!