473,405 Members | 2,176 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,405 software developers and data experts.

can anyone help me with the output for this 1....

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2.  
  3.  main()
  4. { enum {red,green,blue};
  5.  
  6.   clrscr();
  7.   printf("%d %d %d",red,green,blue);
  8.   return(1);
  9.  
  10.   }
Aug 29 '07 #1
4 1045
sicarie
4,677 Expert Mod 4TB
In the future, please use code tags and a descriptive thread title, as outlined in the Posting Guidelines.

So why are you unable to compile this code?
Aug 29 '07 #2
svlsr2000
181 Expert 100+
Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2.  
  3. main()
  4. { enum {red,green,blue};
  5.  
  6. clrscr();
  7. printf("%d %d %d",red,green,blue);
  8. return(1);
  9.  
  10. }
clrscr is declared in conio.h and thats not included. Anyways whats the problem?? clrscr is not standard function, probably thats why you are not able to compile. (If compilations is the problem :^) )
Aug 29 '07 #3
Ganon11
3,652 Expert 2GB
In addition, you declared your main() function without specifying a return type (which, I believe, will default to void main(), a bad practice in itself), but try to return 1 at the end. Also, returning 1 to main() indicates that there was an error in the program - but your program, if it makes it to the return statement, should have executed perfectly fine.
Aug 29 '07 #4
JosAH
11,448 Expert 8TB
In addition, you declared your main() function without specifying a return type (which, I believe, will default to void main(), a bad practice in itself)
It's not allowed anymore; in the C89 Standard no return type defaulted to an
int return type (just as in the good old K&R1 version of C). The C99 Standard
just doesn't allow this anymore. A lot of current compilers still default a lack
of a return type to int though for 'convenience' reasons.

kind regards,

Jos
Aug 29 '07 #5

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

Similar topics

0
by: Dennis | last post by:
I need to do some simple midi code conversion but know zero or rather less about vb. If anyone has done something similar or has a structure which I could follow I'd be very grateful. TIA Den I...
5
by: Clifford W. Racz | last post by:
Has anyone solved the issue of translating lists in Word 2003 (WordML) into xHTML? I have been trying to get the nested table code for my XSLT to work for a while now, with no way to get the...
8
by: MLH | last post by:
A97 HELP shows the proper syntax for using Nz as Nz(variant) I'm wondering what to expect from potential past misuse I've made. For example, consider the following... Private Sub...
4
by: Rukmal Fernando | last post by:
Hi, I've been looking for a good Trace message monitoring tool to monitor trace messages (through System.Diagnostics.Trace.WriteLine() etc). I need it to collect traces from non-EXE code (esp....
3
by: Bret Pehrson | last post by:
Anyone else have this problem? (cpp project) Properties, linker, general, output file, edit Show macros, select any and click click insert -- no action. Anyone else see this? --
3
by: RCS | last post by:
Perhaps you are familiar with the old: <nobr style="OVERFLOW:hidden;width:100px;TEXT-OVERFLOW:ellipsis">blah blah blahblah blah blah blah</nobr> technique.. Well, within a gridview, if I use...
1
by: vv1 | last post by:
Write a C program for reading in a message string (with no blanks) and decoding the message. Store the decoded message in another string called outString. After decoding is complete, print...
0
by: vp1 | last post by:
Write a C program for reading in a message string (with no blanks) and decoding the message. Store the decoded message in another string called outString. After decoding is complete, ...
4
by: Polar | last post by:
Hello everyone! I'm new here. I am doing a project, Digital Compass Navigation Aids. It consists of the 1490 Digital Compass, a P18F4620 Microcontroller, ISD2560 voice record/playback chip LM4808M...
11
by: itgetsharder | last post by:
can anyone help me? code errors! -------------------------------------------------------------------------------- im creating a code for a printer. the question i am trying to answer is : ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.