array output

This is a discussion on array output within the C++ Programming forums, part of the General Programming Boards category; I have stored values in an array and I printed it out. The output looks like the following: 4 5 ...

  1. #1
    Registered User
    Join Date
    Jan 2008

    array output

    I have stored values in an array and I printed it out. The output looks like the following:

    I want my output prints in a horizantale line. Any one know how ?

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Rishon LeZion, Israel
    yes - use space as a delimiter, not a new line
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Can you give me an example ? because I am not quite sure about how to use it ?

    This is what I have:

    void printCode()
    	for(int i = 0; i< 13; i++)
    	return 0;

  4. #4
    Registered User
    Join Date
    Jan 2008
    okay, it could only work if my code contains all of one type but my code is all string? Once I set the result to a string type it sends an error.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    Post actual code and actual error messages.
    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 as the first necessary step to a free Europe.

  6. #6
    Join Date
    Oct 2007
    If you do cout << something << endl you get a newline each time.
    Same with cout << something << "\n". But if you just do cout << something, then you don't get a new line.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Output an array in a textbox
    By Diablo02 in forum C# Programming
    Replies: 5
    Last Post: 10-18-2007, 03:56 AM
  2. Array output strange
    By swgh in forum C++ Programming
    Replies: 1
    Last Post: 12-09-2006, 05:58 AM
  3. Merge sort please
    By vasanth in forum C Programming
    Replies: 2
    Last Post: 11-09-2003, 11:09 AM
  4. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  5. Sorting array output problem
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 02-19-2002, 12:44 PM

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