Friday, May 21, 2010

How do I do this C programming???

I'm trying this "hello world" program and every time I compile the SC, this error message appears:


C:\Program Files\Miracle C\hello.c: line 1: Parse Error, expecting `SEP'


'1: include %26lt;stdio.h%26gt; 2: 3: int radius, area'


aborting compile

How do I do this C programming???
since you didnt show your code, the only thing I see is "include %26lt;stdio.h%26gt;" should be #include %26lt;stdio.h%26gt;, and int radius, area should be int radius, area;. Other than that, who knows without seeing the code you wrote.
Reply:post the source code
Reply:I think there are two booboos here. Try :





#include %26lt;stdio.h%26gt; /* No ; after the lines with a # */





int radius, area; /* Must have ; after normal lines of C */





This is true because the first line is a line intended for the C preprocessor. The second line is a line of standard C code, declaration of two integers named radius and area, to be specific.





I hope this will help you out with the general format.
Reply:All preprocessor directives start with #


That is, instead of


include %26lt;stdio.h%26gt;


mut be:


#include %26lt;stdio.h%26gt;
Reply:The error message is specific to the compiler you're using: Miracle C (http://www.c-compiler.com/guide/errmessp... ). To put is simple, expecting a SEP means the compiler expects you to put a semicolon in a place that you don't put a semicolon in.





AFAIK, preprocessor functions isn't ended with a semicolons, so your code should actually compile correctly.





My guess is, perhaps your DOS environment doesn't recognize the symbol #, so it passes the # symbol as nothing, and this makes Miracle interpret it as a normal C functions. The reason for this is: the error message states "1: include ... " %26lt; the # doesn't appear on this message, while you actually have a # in the source code.
Reply:Which compiler are you using ,programming an hello world in c program is the easiest one .


In Linux , open a text file using vi editor and type your program , save it using wq! , and type gcc %26lt; program name%26gt; . this will create a.out , run that , if any args needed from command line. For other os , search in google.


How to display a picture with windows by programming with c?

i have a program for reading jpeg with c language, but it shows slowly, i want send this picture into memory screen

How to display a picture with windows by programming with c?
You'll want to use an in-memory bitmap (DIB) to expand the picture into, then ask Windows to copy the in-memory bitmap to the screen.


Does anyone know a decent, free C Programming program?

I'm looking for a good, free download that I can use to learn/practice C on. I'd like to keep from spending any money.

Does anyone know a decent, free C Programming program?
Here is a link to various tools.





http://www.dmoz.org/Computers/Programmin...





Here is a link on how "C" works





Check out How Stuff Works.





http://www.howstuffworks.com/c.htm





Good Luck
Reply:well dear contct me via eamil i hv dozens of programs/books/tutorials i can give it to u for free......
Reply:For Windows, probably the best free compiler is the Borland 5.5 C/C++ compiler found at





http://www.codegear.com/downloads/free/c...





If you're running any flavor of linux you already have a fairly decent compiler like g++ already on your system.
Reply:I know it's allot of work, but what I did is downloaded Visual Studio Trial, then re-installed windows after the trial was up. I did that for a year, then found, that if you are in any type of school, you can get the academic version for $50. All the difference between that and the regular version is a little red band on the top and bottom of the box, and you have to type your schools name to register.
Reply:microsoft visual studio of course
Reply:Friend, C is freely available to download. If you are using linux or any kind of UNIX flavor OS, you don't need to do anything. just use "gcc" to compile your C programs and ./a.out to execute them.


If you are using Windows, download TurboC software from


http://www.pitt.edu/~stephenp/misc/downl... and also follow the instructions mentioned there.





To know what the language is all about, go through this basic tutorial http://www.physics.drexel.edu/courses/Co...





Happy C programming.
Reply:You can search it in search engines... Try to search "Teach yourself C in 21 days".. There is a downloadable file in it more likely a PDF format.

memory cards

UrgenT>>> need dijkstra algorithm in c programming.?

i need dijkstra algorithm in c programming. it is use to find out shorthest path between nodes. it must suit for small network which is 3 nodes and large network which up to 30 nodes. thanks for helping..

UrgenT%26gt;%26gt;%26gt; need dijkstra algorithm in c programming.?
Full implementation / example:





http://www.cs.bham.ac.uk/~mhe/foundation...


What is the code for the program C Language?

I've been looking for a code for the program to run, the program is called C Language, and it is our project to discover its code,

What is the code for the program C Language?
I'm not 100% sure if this is what you're asking for, but search for the GCC compiler. It's an open source C compiler that runs on a variety of operating systems.
Reply:Sounds like DOS to me


In the programming language C++, what does the function exit() do, and how do you use it?

I understand that it is a command to exit the program, but what I *don't* understand is why I see a number inside the () as a parameter. In some examples, I see people calling the function and it looks like this: "exit(8);". What is the 8 doing inside the parentheses...?

In the programming language C++, what does the function exit() do, and how do you use it?
It is a return code from the program. The shell that ran the program can check to see if the program exited with an error or normally. I believe return 0 is for normal exit, and return anyother number is for an error.


I know a little bit of C programming, and I've been studying it for a few months now...since april!?

In june, I took a long break, since August(in this time...never opened a c book or wrote a c program!) And I hated it after that...I felt like I lost someone I love! Now, if you do not practice a programming language for a while, do you forget?





And one more question...give me an idea for a useful console C program! I am out of ideas...don't know what to do!

I know a little bit of C programming, and I've been studying it for a few months now...since april!?
It can be difficult to remember the details when it comes to a programming language of any kind if you haven't used it for a while, so don't sweat that problem. All you have to do is find a review on 'C' programming and you'll be fine.





I wrote 3 interesting and informative programs for the console when I was learning and reviewing C++ coding. The first one was a pretty simple application I used to replicate Pascal's Triangle. The user was asked to input some data and the program would output the corresponding data in the triangle.





The 2nd Program I wrote was pretty fun, because I was learning to read and write binary, hex, and Octal in a computer science class. I decided to write a console program that could automatically convert the numbers to their corresponding base-n digits, and even used it during a test! How cool!





The 3rd Program was far more complicated, and was written in both C++ and Java. I was taking "Intro to Java" at Cabrillo College in Aptos, CA, and we had to write a program of our own making for the final project. It was funny, because I made a text-based console game with a controllable character, (quite literally, the character was the letter 'a'), and I ran the game in it's own thread, updating the screen every 10 seconds. The game used character identification for collision detection, and allowed the player to maintain an inventory of gold, weapons, and useful tools. What was funny about this is that I didn't realize the application had to be graphical, not console, and so with two days left I was forced to convert everything over to bitmaps. Unfortunately, this created a major problem with collision detection, and I wasn't familiar enough with threads, so the final project wasn't what it was supposed to be.





Anyhow, it is easy to forget a language, but what you should never forget is how to solve a problem in pseudocode. As long as you know how to write an algorhythm, it will always just be a matter of time before you get the program you want. Of course, I'm sure you already know that.





Good luck with this stuff, and feel free to ask for help on my site, listed below.


-Andy
Reply:No Problem. I'm always happy to help. Report It

Reply:Yes.





www.bloodshed.net





Download free


DevC++

lotus flower