Thread: Joining arrays?

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    25

    Joining arrays?

    Hi everyone.

    If I have the following arrays:

    arrayx...........arrayy
    x1.................y1
    x2.................y2
    x3.................y3

    interx............intery
    IX1...............IY1
    IX2...............IY2

    And I want to display the following

    x...............f(x)
    x1..............y1
    x2..............y2
    x3..............y3
    IX1............IY1
    IX2............IY2

    How is this done?? Ignore the dots....I just placed those in there to display what I'm trying to do better.
    Last edited by C-Struggler; 04-07-2003 at 04:53 PM.

  2. #2
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    Codes for Formatted I/OL - "%-+ Ow.pmc

    I.E. strings being printed and formating of printf

    - left justify
    + right justify
    space print space if no sign
    0 pad with leading zeroes
    w min field width //THIS IS WHAT YOU WOULD USE
    p precision
    m conversion character:

    h short, l long, L long double
    c conversion character

    an example

    Code:
    printf("%12%+Hello");
    this should print a right justified "Hello"
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    25
    I realize that is one way of doing it, but I was hoping to basically place the x and IX values into one array and the y and YI values into another.

  4. #4
    Registered User FCF's Avatar
    Join Date
    Dec 2001
    Posts
    40
    Hi.
    If the data types are same, why not put the joined results into another new arrays?
    Eg. Just copy all elements from "a" into the new array, and copy all elements from "b" after this...
    Life is difficult...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 04:24 PM
  2. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  3. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  4. Building B-Tree from Arrays
    By 0rion in forum C Programming
    Replies: 1
    Last Post: 04-09-2005, 02:34 AM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM