| | |
C Queries
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2008
Posts: 8
Reputation:
Solved Threads: 0
Hi all,
Just started learning C.I have some basic queries.They may sound silly to you.But please bear with me.
-What is the difference between Linking,Runtime and Compilation Error?
-What does getchar() actually do?
-How do turbo C++ and Visual C++ compilers differ from each other?I mean...in what aspects?Do C functions like printf(),etc. give different outputs when compiler is changed?
Thanks
Just started learning C.I have some basic queries.They may sound silly to you.But please bear with me.
-What is the difference between Linking,Runtime and Compilation Error?
-What does getchar() actually do?
-How do turbo C++ and Visual C++ compilers differ from each other?I mean...in what aspects?Do C functions like printf(),etc. give different outputs when compiler is changed?
Thanks
First you write code in some text editor. It doesn't matter what editor, it could even be notepad.
Then you have to compile that code.
Compilation refers to the processing of source code files (.c, .cc, or .cpp) and the creation of an 'object' file. This step doesn't create anything the user can actually run. Instead, the compiler merely produces the machine language instructions that correspond to the source code file that was compiled. read for more
Compilation error is therefore something that occured during this phase, most likely syntax error (misspelled some function name, or trying to do something that C doesn't allow)
So, after compilation, you have object files. In simple programs you have only one object file, so it's difficult to understand need for it (why not just build everything at once?).
But if you have more different files that you want to merge into one program, first you have to compile every single one into object.
Then it's linker's job to take all object files and to make executable out of it.
Linker error is most likely definition/declaration error (you can have function defined in one file, and declared in another. If these two aren't identical linker error occurs).
Runtime error 99% of the time has to do with evil horrible pointers. It happens at the time program is working, and therefore, the mistake cannot be located so easily.
Mostly has to do with program trying to acces/alter forbidden memory, OR program altering memory it should not!
char getchar(void);Returns one character from stdin buffer (a.k.a. your keyboard)
They differ a lot, since turbo c++ compiler is ANCIENT.
There is something that is called standard C++ language. It wasn't fully defined at turbo c++ time, so some things that were differently defined don't work nowadays.
My advice is: don't go with turbo c++, get some new compilers.
And try not to use c++ compilers, although they should work with C
To answer specific question: printf() is the same as before.
Last edited by Sci@phy; Oct 18th, 2008 at 2:23 pm.
•
•
•
•
They differ a lot, since turbo c++ compiler is ANCIENT.
There is something that is called standard C++ language. It wasn't fully defined at turbo c++ time, so some things that were differently defined don't work nowadays.
•
•
•
•
And try not to use c++ compilers, although they should work with C
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
•
•
I am unaware of any compilers that are C only designed in the last 18-20 years, especially based on the recommendation to get a new compiler. Virtually all compilers today are C++ compilers and, since C++ is (guestimate) 75% or more C, they all compile C without problems.
(I don't know if a turbo c++ compiler can compile C like plain C or it compiles it as C++?)
>Will turbo C++ allow C99 standard things?
Most modern compilers don't compile C99. It's not a popular enough standard even to be completely implemented, much less widely implemented. You'll be hard pressed to find a C++ compiler that isn't very stable with C89 though, provided you pass it the right switches to compile as C instead of C++.
>I am unaware of any compilers that are C only designed in the last 18-20 years
LCC Win32 is strictly C, and is being actively developed with the goal of C99 conformance.
Most modern compilers don't compile C99. It's not a popular enough standard even to be completely implemented, much less widely implemented. You'll be hard pressed to find a C++ compiler that isn't very stable with C89 though, provided you pass it the right switches to compile as C instead of C++.
>I am unaware of any compilers that are C only designed in the last 18-20 years
LCC Win32 is strictly C, and is being actively developed with the goal of C99 conformance.
I'm here to prove you wrong.
![]() |
Similar Threads
- SQL Queries help (Database Design)
- Create Access Database using SQL queries (MS Access and FileMaker Pro)
- MS Access Queries not working in 2007 (MS Access and FileMaker Pro)
- snmp queries to printer (Networking Hardware Configuration)
- Multiple queries within one php file (PHP)
- Updating database with related tables and queries?? (VB.NET)
- Log files for submitted LDAP queries (Windows NT / 2000 / XP)
- Using exisiting queries within MS Access (ASP.NET)
- securit issues fundamental - few queries - follow up (Viruses, Spyware and other Nasties)
- request for ansi sql queries equalent to MS access (Visual Basic 4 / 5 / 6)
Other Threads in the C Forum
- Previous Thread: just need a little bit of help on fgets
- Next Thread: getchar()
| Thread Tools | Search this Thread |
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string strings suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h






