Getting error while run the program in C language - c

Getting warning each time while run the program in C.

This is not Error this is just a Warning .
Save the file every time before you Build and Run. This is the solution to your warning.This warning happens when you edit the program and tries to run it without saving.
Also your IDE Turbo C++ is very outdated Programming environment.I recommend CodeBlocks . Code::Blocks is a free C, C++ and Fortran IDE built to meet the most demanding needs of its users. It is designed to be very extensible and fully configurable.You can download it from here.

It seems like you are running this application in some sort of emulator.
Restart the program and try running that.
It should work.
Turbo C is terribly out of date and is probably even older than you.
I suggest you to upgrade to a IDE like Code::Blocks.
If, you are a beginner I suggest you compile using GCC command line compiler.

Save the file before you run/compile your code.

Related

Using make to compile code in c in terminal on Mac

I'm trying to learn to program in C and I'm getting used to compiling the code after writing it. I'm actually using K&R 2nd edition to start off and they use 'cc' to compile. I originally started using Zed Shaw's Learn C The Hard Way but I've stopped because I haven't heard many good things about it. Zed Shaw's way was to use 'make' to compile code, at least in the beginning.
Is there any technical difference between using 'make' and using 'cc' that I should be concerned about right now?
make simply gives commands to the compiler, such as cc. It automates building a project which has multiple files. To begin, you do not need to concern yourself with those details. Building a single file directly with cc is fine. In fact, you will understand how the compiler works so that you can get the most out of make when you eventually learn it.
I agree with code-apprentice. I would just add that it is important to have a good understanding of different cc command line options before moving on to make. When you reach the point of a more complexe compilation project and the build process of your final binary becomes a pain, that's when you can transition to learning Make!

Problems when using Lcc-Win compiler

I am new to programming here and pushing my limits to learn C as my first language. I have installed a compiler LCC-Win. However when I created a code with two or more functions and compile it, I always stuck to the problem where "compiler has stopped working" and file not created although the compiler says it is. Is this only me or should I change to other compiler?
By the way I am using a Windows 7 64-bit.
Thank you for advance.

Run C programs from sublime 2.02

I want to compile and run C/C++ programs with sublimetext 2 itself.I dont want to use terminal to do so. What do I need to do for this??I am compeletely new to this so a lot of answers to similar questions did not help me as most of them were for windows.
sublime text 2 build system for C programming language should show you how to setup your build environment. Note: you need gcc etc. installed
Edit: you should although run your programm in a Terminal because SublimeText2 is an Editor and can not recieve user input for your programm. so you better just build it with ST2 and run it in Terminal or you just forget about ST2 and make your own Bash script that manages compiling and runs the programm.
I would use sublime text as an editor (which is what IDEs are). Then you'll need to have a Makefile for your program. And build it by typing make in a terminal (or by configuring your editor to run that command). BTW, you can type m a k e enter once in your day (and later use up in the same terminal, to reapeat the latest command).
Learning how to write simple Makefile-s is a reusable skill (see here for "why?"). See this and that and many other examples. Don't attach yourself to one particular editor (even if you may like one more than others; my preference goes to emacs).
You'll learn a big lot by studying (and improving) the source code of some free software. Look at sourceforge, github, etc.. to find some free software interesting to you, then download its source code, build it, and study it.
The tips and advices I gave here are still valid today, with a recent Ubuntu (e.g. 14.x)
BTW, your question looks like you might be confused; Sublime Text is an editor (perhaps glorified as an IDE). It does not compile anything. The C or C++ compiler on Ubuntu is GCC (using gcc command for compiling C code, and g++ command for compiling C++ code) or perhaps Clang/LLVM (using clang command for C code, and clang++ command for C++ code). That compiler is often started by make, and IDEs on Linux are often running make -or directly the compiler- command for you. You'll better be able to run these commands yourself.

ld.exe has stopped working

I am using Dev-C++ V(4.9.9.2) and trying to build a solution that performs some system based programming specifically that calls the Windows Service Manager. Now whenever I try to build my application, it halts with a message
ld.exe has stopped working and the application stops. I don't understand why this is happening when everything else falls right in place.
Don't use Dev-C++. It is ancient and so is its compiler.
Use a modern compiler environment like those available at http://mingw-w64.sourceforge.net/, or get an IDE with a newer MinGW(-w64) compiler, like Qt Creator, CodeBlocks, or even http://sourceforge.net/projects/orwelldevcpp/, etc...

c exec embeded in webpage

Does anyone know for a tool that allows a c executable to be run in the browser? I'm looking for a javascript, java, or flash solution because I don't have privileges to run c executables on the server.
The executables are basic input and output programs.
Looking at your comments, I hear you mention students and running simple programs. As a suggestion, you might want to look into CodePad. This will let you interpret simple C programs. Note that everything needs to be in one place, so you'll have to combine C and header files.
Here is a sample:
http://codepad.org/qQS31BwM
EDIT
Here's another one I found:
http://ideone.com/
When you run the program, at the bottom there is a link for input. You can use it to run the program with given input as entered.
You could use this as a basis for solving the problem:
http://bellard.org/jslinux/
Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode (which can be generated from C/C++, using llvm-gcc or clang, or any other language that can be converted into LLVM) and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).
Using Emscripten, you can
Compile C and C++ code into JavaScript and run that on the web
Run code in languages like Python as well, by compiling CPython from C to JavaScript and interpreting code in that on the web

Resources