Thread: New dude needs help

  1. #1
    Registered User
    Join Date
    Jun 2020
    Posts
    3

    Exclamation New dude needs help

    Hi could someone help me with a code of mine? its a 4x6 array and i wish to delete the secound row pls help my code
    Code:
    static void Main(string[] args)
            {
                int[,] m = new int[4, 6];
                Random r = new Random();
                for (int i = 0; i < 4; i++)
                    for (int j = 0; j < 6; j++)
                        m[i, j] = r.Next(1, 150);
                double s = 0;
                for (int i = 0; i < 4; i++)
                {
                    for (int j = 0; j < 6; j++)
                    {
                        Console.Write("{0,5}", m[i,j]);
                     
                    }
                    Console.WriteLine();
                }
    
    
                Console.ReadKey();
            }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,114
    Are you looking to just not print the second row, or are you trying to create a new new int[3, 6]; ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2020
    Posts
    3
    Not to print the secound row

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,114
    Add in a line somewhere like

    if ( i != 2 )
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jun 2020
    Posts
    3
    Thank you

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Hint for an old dude
    By Tdawg75 in forum C++ Programming
    Replies: 4
    Last Post: 03-06-2013, 10:17 PM
  2. The end of piracy - according to this dude
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 05-28-2008, 07:12 PM
  3. New dude needs simple help :P
    By XunTric in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2005, 10:22 AM
  4. This dude need someones help, bad????
    By correlcj in forum C Programming
    Replies: 9
    Last Post: 07-12-2002, 09:28 PM

Tags for this Thread