No the second dot does NOT disappear... Watch  your output closely.
You should also get yourself a linux distribution ( www.knoppix.org
has bootable CD or DVD images ).  and try the command 'man ctime'
(the reason why I say that is that is that 'PAUSE' is a DOS command)

The %.24s says "Only print the first 24 characters of the output
from 'ctime'.  You see, the output from ctime includes a newline as
the last (25th) character of it's output,  so  %.24s chops off the output
just before the newline.

I.e. the resultint output is   <DATE>\n.\n

The trailing dot is now on the next line.

_z33 wrote:

sumit kalra wrote:

Well, the first dot along with the 24 (%.24s) specifies to printf to print only 24 characters of the
string.

Second dot is a full stop after the string. :-)


Thanks for the info.

But in that case when you remove the first dot you should be able to see the second dot for sure, right? But the moment I remove the first dot, the second dot disappears from the output.

       printf("It's %.24s.\n", ctime(&now));
       system ("PAUSE");

--
Stephen Samuel +1(604)876-0426                [EMAIL PROTECTED]
                   http://www.bcgreen.com/~samuel/
  Powerful committed communication. Transformation touching
    the jewel within each person and bringing it to light.

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to