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

  • Home
  • SEARCH
  • 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 459743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:48:12+00:00 2026-05-12T22:48:12+00:00

I am trying to understand how this piece of self-replicating code works (found here

  • 0

I am trying to understand how this piece of self-replicating code works (found here), but the problem is I can’t get it to run as-is:

class c {
    static void Main(){

        string s = "class c{{static void Main(){{string s={0}{10};System.Console.Write(s,(char)34,s);}}}}";

        System.Console.Write(s,(char)34,s); //<<-- exception on this line

    }
}

It’s throwing an exception on writeline: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

Can someone help – in particular about the formatting option {0}{10}?

I got it working like this (see below) but it’s longer than the original – I am curious how the original could have worked as-is in the 1st place:

class c {
    static void Main(){

        string s = "class c{{static void Main(){{string s={0}{1}{2};System.Console.Write(s,(char)34,s,(char)34);}}}}";

        System.Console.Write(s,(char)34,s,(char)34);
    }
}
  • 1 1 Answer
  • 1 View
  • 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-12T22:48:12+00:00Added an answer on May 12, 2026 at 10:48 pm

    I think there is a pair of braces missing – instead of {10} it should read {1}{0}.

    class c {
        static void Main(){
    
            string s = "class c{{static void Main(){{string s={0}{1}{0};System.Console.Write(s,(char)34,s);}}}}";
    
            System.Console.Write(s,(char)34,s); //<<-- exception on this line
    
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still trying to understand this piece of code that I found in a
I am trying to understand this inline assembly code which comes from _hypercall0 here
In trying to understand Go, I ran into this piece of code in websocket.go
I trying to understand this piece of code Function.prototype.method = function (name, fn) {
Recently I saw this piece of JavaScript code, but have been unable to understand
Can someone help me understand this piece of code: char *line = new char[2048];
I am trying to compile this piece of code found below. However, I got
I'm trying to understand how this piece of code from Keith Peter's Advanced Actionscript
I am new to pylon and trying to understand this piece of code: map.connect(':controller/:action/:id')
I'm having a small bit of trouble trying to get this piece of code

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.