Learning from Java to C ...... What is the biggest problem?

I had experience working in Java, due to some results I need to encode in C, is it difficult to switch from Java to C? And what is the biggest difference between the two languages?

+5
source share
7 answers

No question, first of all, is manual memory management.

Secondly, C has no objects, so C code will tend to be structured very differently from Java code.

Edit: a little joke: about 15 years ago, when it was common for a local ISP to log on to a UNIX command line, when PPP was still fairly new, and when university campuses still had plenty of dumb terminals for UNIX servers, many had a program called fortune that will run when we log in and output a random geeky platitude, I literally laughed out loud once when I entered the message:

C is a programming language that combines the power of a language assembly with the flexibility of an assembler language.

This is ridiculous because it is true: C is an assembly language of modern computing. This is not criticism, but simply observation.

+13
source

, , . Java , , C , , .

+3

, C - . , , , , .

+3

Java , C - . . , , .

C , , , , , , xml .. , , undefined, , , .. .

.

+2

C, OO, ( ), , ( ), " " , , , ( , C).

, , GCed, . , "" ? , , ?

+1

: , , ( ). :

  • ,
  • , , ints . C: if (!ptr) { /* null pointer detected */ }
  • . : ptr2 = ptr + 10; ptr2[-10] ++; ptr[0] ++;.
  • char . .
  • (.h .c) #include, . , (, #include s) .
  • And finally, C has an operator goto. But, if you ever use it, Dijkstra will rise from the grave and chase you.
+1
source

Java is garbage collection, C is not. C has pointers; Java does not. Java methods most often use indirect use of links, and C - explicitly indicate when you pass the link. Many more considerations.

0
source

All Articles