Exam sample paper problem heeelp

This is a discussion on Exam sample paper problem heeelp within the C Programming forums, part of the General Programming Boards category; how to copy three charaters of a string of strg2[] into strg1[]...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    14

    Exam sample paper problem heeelp

    how to copy three charaters of a string of strg2[] into strg1[]

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Use a for loop and assignment, srg[i] = strg1[i]. If the two arrays aren't "in synch" with each other, use [i] and [j] to keep them working OK.

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    1,053
    Code:
    strg1[0] = strg2[0];
    strg1[1] = strg2[1];
    strg1[2] = strg2[2];

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    > how to copy three charaters of a string of strg2[] into strg1[]
    Tell us your approach, and ask us to validate / comment on it.

    Because you've posted three "exam" questions in the last couple of hours, and all of a sudden, it looks like we're the ones passing your exam for you.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 10-05-2012, 01:50 AM
  2. Exam Scheduling Problem
    By itsacezon in forum C Programming
    Replies: 4
    Last Post: 10-19-2011, 09:52 AM
  3. Help with past yr exam paper
    By shermaine in forum C Programming
    Replies: 3
    Last Post: 10-27-2006, 01:45 AM
  4. sort problem for an exam
    By rjeff1804 in forum C Programming
    Replies: 10
    Last Post: 02-12-2003, 09:33 PM
  5. HEEELP!!! More On Capturing VK_RETURN...
    By Sebastiani in forum Windows Programming
    Replies: 1
    Last Post: 11-01-2001, 04:13 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21