Thread: C question...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    101

    C question...

    '\0' is a spacebar in C
    After i input a string, e.g abc de
    How cam i know the end of an array ??

    thx...

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    > '\0' is a spacebar in C

    No it isn't. It is NULL, or a zero value, used commonly to denote the end of a string.

    > After i input a string, e.g abc de

    Use fgets or scanf with the appropriate arguments.

    > How cam i know the end of an array ??

    I'll assume that you mean "end" as in: the first unused cell in an array.

    You can use strlen to find the length, or you can just loop through the array looking for NULL.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    22

    Thumbs up end of an array...

    hello dking,
    u can use the 'sizeof()' operator to know the length or size of your array variable.
    i'm using Turbo C and its compiler.
    thanx...
    take care...
    _________
    Jackie

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM