- #include<stdio.h>
-
-
main()
-
{ enum {red,green,blue};
-
-
clrscr();
-
printf("%d %d %d",red,green,blue);
-
return(1);
-
-
}
4 1045
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?
- #include<stdio.h>
-
-
main()
-
{ enum {red,green,blue};
-
-
clrscr();
-
printf("%d %d %d",red,green,blue);
-
return(1);
-
-
}
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 :^) )
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.
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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....
|
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?
--
|
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...
|
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...
|
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, ...
|
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...
|
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 :
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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,...
|
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...
|
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: 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,...
| |