Really simple question

This is a discussion on Really simple question within the C Programming forums, part of the General Programming Boards category; I have a really simple question. Is it possible to do this? Code: Examplearray1[a] = Examplearray2[b] Because in my program ...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    13

    Really simple question

    I have a really simple question.
    Is it possible to do this?
    Code:
    Examplearray1[a] = Examplearray2[b]
    Because in my program i get rubbish when i print Examplearray[b]

  2. #2
    language hopper dennis.cpp's Avatar
    Join Date
    Jan 2011
    Location
    Herborn, Hesse, Germany
    Posts
    197
    The way you ask your question makes me suggest what you wanted was:

    Code:
    Examplearray2[b] = Examplearray1[a]
    The source of an assignment always goes right of the operator, the target goes left of it.
    Last edited by dennis.cpp; 12-09-2011 at 04:57 AM.
    Hardware: Intel® Core™ i7-3630QM CPU @ 2.40GHz × 8
    Operating system: Fedora 19 (64-Bit) / Linux 3.11.6-200.fc19 / KDE SC 4.11.2
    Compiler: gcc 4.8.2 with Netbeans IDE 7.4

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. really simple question
    By JezW in forum C Programming
    Replies: 8
    Last Post: 04-25-2009, 07:25 PM
  2. simple question please help!!!!!!!!
    By masood123 in forum C++ Programming
    Replies: 3
    Last Post: 07-01-2008, 09:42 PM
  3. simple simple design question
    By Chaplin27 in forum C++ Programming
    Replies: 6
    Last Post: 05-31-2005, 11:33 PM
  4. a simple question??
    By Bob the Builder in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 05-07-2002, 12:03 PM
  5. a simple C++ question
    By DramaKing in forum C++ Programming
    Replies: 7
    Last Post: 02-08-2002, 07:13 PM

Tags for this Thread


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