473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

print the values of the predefined symbolic constants

I m not able to understand how i print the values of predefined symbolic constant.
i have to print the values of
_lINE_ The line number of the current source code line (an integer constant)
_FILE_ The presumed name of the source file (a string)
_DATE_ The date the source file is compiled (a string of the form “Mmm dd yyy” such
as Jan 19 2002)
_TIME_The time the source file is compiled (a string literal of the form “hh:mm:ss”)

i m not able to understand how i print the values of these predifined symbolic constant

please help ,me guyssssss
Jul 22 '10 #1
4 3565
whodgson
542 512MB
@AnagJohari
Just use say printf() and specify the name of the predefined macro say _TIME_.If _TIME_ has a value of
"11:10:09" it will print 11:10:09.
Jul 23 '10 #2
donbock
2,426 Expert 2GB
What have you tried?
Jul 23 '10 #3
@whodgson
Not working
i try
Expand|Select|Wrap|Line Numbers
  1. #include<conio.h>
  2. #include<stdio.h>
  3. #define _TIME--->its not working whether i use this statement or not
  4. void main()
  5. {
  6. printf("%d",_TIME_);
  7. getch();
  8. }
  9. i also use this printf(_TIME_);
  10. but not working.
  11.  
  12.  
can write the code please
Jul 23 '10 #4
donbock
2,426 Expert 2GB
You must remove line 3. You definitely do not want to define any of these built-in macros yourself, let the compiler take care of defining them for you.

Part of your problem is that you are misspelling the predefined macros. They begin and end with two underscore characters.

Another problem is using "%d" format string for __TIME__. This format string is for a number, but the macro expands to a quoted string.
Jul 24 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: ashtonn | last post by:
Hello, How do i print values returned by Py_BuildValue in Linux? PyObject *obj = Py_BuildValue("{s:i}", "Status", status); I need to print the Status value here -Thanks, Ashton
35
by: Sandeep Sharma | last post by:
Right from the time the first edition of K&R was released, the advantages of using symbolic constants, as opposed to "magic numbers", has been emphasized ---- and for good reason. I don't dispute...
2
by: merkury1 | last post by:
Does C# have any predefined preprocessor constants like the C/C++ compiler does? In C++ you had such predefined constants as: __cplusplus, _DEBUG, _WIN32, MSC_VER. Are there any such things for...
3
by: annecarterfredi | last post by:
I am developing a new trigger and I would like to print Old and New values of few columns. I know I can create new table and insert Old and New values, but I would like to have simpler solution for...
48
by: Wolkec | last post by:
How can i open a file with fopen and print the values?
4
by: Mtek | last post by:
Hi, We have a combo box on our page, which gets populated via a MySQL Query in PHP. What we want to do is to print the values on the page in a table that correspond the to selection from the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.