Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7052381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:22:35+00:00 2026-05-28T03:22:35+00:00

I am new to programming with no formal programming training, so please excuse this

  • 0

I am new to programming with no formal programming training, so please excuse this newbie question. I can’t seem to find a definitive answer on it, and need to be sure.

Here’s the scenario: sometimes I need to try different lines of code to see if they work, but still want to keep the original lines in there in case the new lines don’t work (or for future reference). I thought by putting // in front of the line I want to “comment out” would mean the line of code would be ignored when compiling the program, but my app crashed and pointed to a line I thought was commented out. I am using Xcode 4.

Is there another symbol I should be using to comment out lines or blocks of code? For example, will /* at the beginning and */ at the end accomplish this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:22:35+00:00Added an answer on May 28, 2026 at 3:22 am

    For “commenting out” big blocks of code, I do conditionals like:

    #if I_AM_TESTING_SO_DONT_COMPILE_THIS
    ...
    ...
    ...
    ...
    #endif // I_AM_TESTING_SO_DONT_COMPILE_THIS
    

    And yes, the traditional C-style /* and */ also work to “comment out” blocks of code.

    The reason your compile crashed with // is because while a single line gets commented out, you might have had some extra code on a second line.

    Such as:

    //NSString * someContentFromSomewhere = [[NSString alloc] initWithContentsOfURL:
        [NSURL URLWithString: @"http://www.stackoverflow.com"]];
    

    The first line is commented out. The second line is a syntax error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to Python programming so I have this question: How can I
I'm new to programming and want to find something that I can work on
Im new to C# programming. Can someone please explain the following code: Console.WriteLine( {0}{1,10},
I am very new to programming so please excuse me if there is an
I am new to this shell-script programming so need your help to write a
I've came across this new acronym, SOFEA, apparently a new programming paradigm for web
I need to write a few c header wrappers for a new programming language
I'm quite new to Java Programming and am writing my first desktop app, this
I am new to programming and come from a non-CS background (no formal degree).
I am new to C# and programming in general my question is how do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.