TRENDING NEWS

POPULAR NEWS

What Is C And C Language

Who invent C and C++ Language?

I can see that you have a internet connection because You have posted this question up her to http://Quora.comYour question turned my stomach upside down!Why you have posted here and waited for answer for this long? Since you have internet connection you may have googled it!At last, Here is the answer to your question:C++ was invented by Bjarne Stroustrup.C was invented by Dennis Ritchie along with Dennis also invented and invested in Uinx operating system and ALTRAN and many more things.

Is _flushall() C language or C++?

Hm....









Yup!
Prototype in stdio.h
int flushall(void);
Clears buffers for input streams and writes buffers to files for output
streams.
Returns an integer, which is the number of open input and output streams.
Ex:
#include
int main(void){
FILE *stream;
/* create a file */
stream = fopen("DUMMY.FIL", "w");
/* flush all open streams */
printf("%d streams were flushed.\n",
flushall());
/* close the file */
fclose(stream);
return 0;
}

What is meaning of & in c language?

‘&’ acts as ‘Address of’ and ‘Binary AND’ operator.Like when you write -scanf(“%d”,& age);It tells the compiler that whatever the ‘integer value’ will be supplied to the program at this point, it will be stored in the space allocated as ‘age’ or say, at the address of the variable ‘age’.(A & B) = 12Here, it is Binary AND Operator that copies a bit to the result if it exists in both operands.unsigned int a = 60; /* 60 = 0011 1100 */
unsigned int b = 13; /* 13 = 0000 1101 */
int c = 0;

c = a & b; /* 12 = 0000 1100 */
printf("Line 1 - Value of c is %d\n", c );
Result - Line 1 - Value of c is 12As Bitwise operators are a bit difficult to learn than other operators, I am here adding an example. Hope it helps -#include

main() {

unsigned int a = 60; /* 60 = 0011 1100 */
unsigned int b = 13; /* 13 = 0000 1101 */
int c = 0;

c = a & b; /* 12 = 0000 1100 */
printf("Line 1 - Value of c is %d\n", c );

c = a | b; /* 61 = 0011 1101 */
printf("Line 2 - Value of c is %d\n", c );

c = a ^ b; /* 49 = 0011 0001 */
printf("Line 3 - Value of c is %d\n", c );

c = ~a; /*-61 = 1100 0011 */
printf("Line 4 - Value of c is %d\n", c );

c = a << 2; /* 240 = 1111 0000 */
printf("Line 5 - Value of c is %d\n", c );

c = a >> 2; /* 15 = 0000 1111 */
printf("Line 6 - Value of c is %d\n", c );
}
ResultLine 1 - Value of c is 12Line 2 - Value of c is 61Line 3 - Value of c is 49Line 4 - Value of c is -61Line 5 - Value of c is 240Line 6 - Value of c is 15Sometimes you may find && operator. It is called Logical AND operator. If both the operands are non-zero, then the condition becomes true.if(num>=20 and num/4 = 0)
{
printf(“Hello there”);
}
It will result into “Hello there” if the provided value in num is greater than or equals to 20 and divisible by 4.

What is UNIX? How is it related to C and C++?

Everyone else have given a great break down on the subject. I won’t repeat that.I want to stress the chronological and causal relation between the three objects you related in the question. Please read to the end, this is important history.UNIX project started in 1969 by Ken Thompson and Dennis Ritchie.In 1972 (I think, or ‘73) they wanted to deploy their system on platforms other than the original PDP-11. They wanted to rewrite the kernel in a high level language, which was something of a blasphemy at the time, no one ever heard about an OS kernel that wasn’t in assembly, nor did they imagine one. The high level languages at the time weren’t low level enough, so they had to invent a middle level language to suit their only need: write an (almost) cross-platform OS kernel. And C was born. The authors of C were Brian Kernighan and Dennis Ritchie. Yep, the same Richie in both projects.A few years down the road, C was being used for things other than its original purpose. People started bitching about pointers, broken memory accesses, lack of OO features, etc. This led to the invention of C with classes. A great idea, had it been engineered properly. This evolved into C++.Now if the designers of C++ rewrote the language from scratch (like the other son-of-C languages did: Java, Perl, …) it would have been a great language. Instead they tried to build OO features on top of a bare-metal-bone language like C. The result: that malformed creature from Aliens.So, if any one tells you that UNIX and C are not connected, it is your holy duty to correct them:UNIX and C are two sides of the same coin. C was invented solely to write the UNIX kernel. UNIX is the OS that went viral because of C.

What is similarities between c & c++?

Well, the big similarities are as follows:

- syntax, as both have the same syntax
- grammar, although C++ has a slightly extended grammar (all the OOP features introduce a few new operators)
- code structure
- the compilation is about the same (not 100% sure, but it should be given that syntax & grammar are similar)

What is the difference between matlab and c (or c++)?

Matlab and C can do a lot of the same things. Both can be used to generate all kinds of programs, from GUIs to physics simulations. Matlab can even easily interface with C. However:

Matlab is proprietary, while C is not. This is a big difference. You need to pay for Matlab but you can get C compilers that are open source.

Matlab is designed for technical (and primarily engineering) users, while C is much more general.

Both can be used to interface with other devices.

C is far more useful for things like high-constraint codes in that you can more directly control what your code does. It might not be easier, but you can usually write C code that's more efficient than Matlab in many areas, especially things like embedded systems where Matlab isn't an option.

C is older, so it may be the only way to interface with some older devices (besides others like BASIC and proprietary HP languages). You may be able to do this with Matlab also, but it will probably end up being a call of a C routine.

Matlab provides a step of user-friendliness between scientific computing tools like Fortran and totally general tools like C. Matlab actually uses C, it's just a layer above the raw C code with many built-in functions that are useful for technical (math/engineering/science) users.

Is C# programming language the same as C?

No. C# was developed by Microsoft to compete with Java and allow Java developers to embrace the Microsoft world.There are some similarities to C, just as Java shares some similarities, such as the use of braces, semi-colons, and the general way methods and variables are defined. If you can read C, you shouldn’t have much difficulty reading a C# program to get the general idea, but that’s as far as it goes.C# is an object oriented language with classes, interfaces and structs. In that sense, its closer to C++ than to C.

What is the difference between QBASIC and C programming language?

It depends on what you are doing and why. I still use QBASIC (and used MBASIC and used IBM's ROM-based BASIC [BASICA] as far back as 1983) for some things. And I'm a professional. Mostly, it's used for quick tests/verifications or where I don't need Windows' facilities and don't want to bother about setting them up. It's quick to use. I also will use HP 2000F BASIC, via an emulator, because it includes very sophisticated floating point transcendentals (Cheby + minimax) and has built in matrix facilities like inverse, determinant, and multiplication, for example. (MAT A=INV(B) for example.) I've also had clients insist. Though usually from one of the compilers, such as QB 4.5 or BC 7.1 or VB-DOS. Doesn't happen much, but it happens. (I also happen to have complete sources to QB 4.5 and DOS 6.0. But that is another matter.) QBASIC is easy to use and easy to share with others. And yes, it's great for hobby work.

One of the better ways to learn game programming is with QB 4.5, for example. You get certain graphical modes and with Microsoft's emulation of the VGA hardware, you can do some pretty fancy things with it while learning the ropes. Eventually, you grow out of it. But you can do fast page flipping, tiling, animation, and smooth scrolling effects within QB, as well. (It's not quite so good with QBASIC, but doable.)

Finally, debugging is trivial in QBASIC. If something breaks, you can sit down at the bottom lines and just enter immediate mode statements to print out variable values and so on. Figure out what went wrong. So you learn fast.

C on the other hand is a very different domain. Debugging is good, but takes a little more effort. And it is a compile-run mode, which does slightly slow down some of the debug efforts. But it is incredibly versatile and is very good to learn.

Only you can decide which is better. But they are both pretty easy to try out with a few simple programming tasks. Why not set yourself the goal of doing some simple programs in both and see what you decide about it. It'll just be a day or two of effort and you can quickly get a feel for the two development environments. (I don't know which C you are talking about, but it may or may not be tricky to install [if you aren't already knowledgeable about it] and use depending on which you are considering.)

TRENDING NEWS