is " void" a datatype in any computer language?
116319
In C, "void" has three distinct uses.\n\n1) Return values for functions. If a function returns literally NOTHING, then it is declared as returning void. This tells the compiler not to push/pop any return value on/off the stack on return. It also tells the compiler that the result of the function cannot be assigned or compared to any variable.\n\n2) Generic pointers. When you are dealing with generic pointers, such as returns from "malloc", parameters to "free", "memcpy" and such, these functions need pointers, but they really don't care what data type the pointers actually point to. Rather than declaring a copy of these functions that returns every possible atomic type (char, short, int, long, float, double and such), they simply use a pointer to type void (void*) instead.\n\n3) Ignoring return values. If you are using a particularly picky compiler, or even a program such as Lint that produces warnings when you ignore the return value of a function that returns something other than void, you can cast the function call to type void to make the warning go away if you really don't need to know the return value.\n\nFor instance, "printf" returns an "int" value. So if you use the following line in your program:\n\nprintf ("Hello world");\n\nit could actually generate a warning, since you ignore the return value. If instead you use the line\n\n(void) printf ("Hello world");\n\nyou are telling the compiler that you are purposefully ignoring the return value, so it will not issue a warning in this case. This is of particular use if you have a policy of zero warnings (as all programmers should).\n\n"Void" kind of lives in limbo just outside of datatypes - it is not a modifier such as "static", "const" or "volatile", but it is not possible to declare a variable of type "void". It is kind of in its own little world there.
52026
#define TRUE  1\n#define FALSE 0\n\n#define ESC      27\n#define F2      188\n#define UP      200\n#define FWD     205\n#define DN      208\n#define BS      203\n\nint getkey(void);\nint keyhit(void);\nvoid curr_cursor(int *, int *);\nvoid cursor(int, int);\nvoid hidecursor(void);\nvoid unhidecursor(void);\nvoid savecursor(void);\nvoid restorecursor(void);\nvoid set_cursor_type(unsigned);\n#define normalcursor() set_cursor_type(0x0607)\n\n\nlook at this code to understand how each function works.\n\nhttp://202.179.135.4/data/DDJ/articles/1991/9103/9103i/9103i.htm#00c1_0013
590165
no, there are no pointers in Java, which means no memory addresses.  Whenever you pass a variable to a function, you pass a reference, neither a copy of the variable or the variable's address.
935645
main() { static char *a="n0body"; char b[512],*c,*d;\n  while (c=gets(a)) for (d=a;c;*c^=*d,c++,d=*++d?d:a);\n  printf ("%s&#92;n",b);}\n\n\nhappy?
116146
By using "Call by Reference", we can modify values that passsed to a function. If we use "Call by Value", we can not modify value of parameters, because actually we just modify values that stored in stack, not in the memory.\n\nHere is the example. In the main program, we pass a variabel contains number 1, and functions try to change it. Excuse me, my English is bad.\n\nvoid test_one(int a) {\n  a = 2;\n};\n\nvoid test_two(int *a) {\n  *a = 2;\n};\n\n// C++\nvoid test_three(int &a) {\n  a = 2;\n};\n\nvoid main(void) {\n  int a;\n\n  a = 1;\n  test_one(a);\n  printf("%d&#92;n", a);  // Result: 1;\n\n  a = 1;\n  test_two(&a);\n  printf("%d&#92;n", a);  // Result: 2;\n\n  a = 1;\n  test_three(a);\n  printf("%d&#92;n", a);  // Result: 2;\n};\n\n"&" sign means: Address of this variable in memory.\n"*" sign means: Address that pointed by this memory address.\n\nThe best way to understand this, is by examine the Assembly Code of this program. You can use Turbo Debugger or just DEBUG.COM.\n\nIf you think my answer is the best answer, would you please do rate mine? Thank you.\n\nGreetings from Tangerang, Indonesia.
662885
No difference ,they are all used for dynamic allocation.only syntax difference i guess.
1023405
Not that I know of. I use good old C++ to do molty threading and dual core programing. I wish they would come up with one I am tired of all the extra work needed to lock resources.
765091
Mn is close, but there are 2 errors:\n\n1) There is no len() function.  Use strlen() instead of len().\n\n2) He didn't allocate enough memory for the sprintf to fit the entire result string in the buffer.  The line needs room to store the &#92;n (or in windows, 2 chars - cr and lf ) in addition to the null terminator.  So, his code needs to add 2 instead of 1 to the length calculation.  \n\nTaking this a little further, the number of chars should be multiplied by the sizeof(t_char), which MIGHT NOT be 1 byte if the code is destined to use unicode.\n\nChances are, this is ascii, so the multiplication is unnecessary, but it is better to be safe than sorry.  Besides, if this was production code, you'd want to be able to use the same code in both places without any need to change it.  Nothing worse than having to go back and recalculate buffer manipulation code during a port.\n\nThe above subtleties demonstrate precisely how and why it is so very easy to make a mistake in c/c++, leading to a buffer underallocation or overwrite, and hence a security hole.
532980
I'm sorry but did you see this in My_Computer properties?\n\n\n\n--- ► λ ◄ \n\nN.B. I'm still a learner.
117995
There are five data types for C: void, integer, float, double, and char.\n\nvoid: associated with no data type \nint: integer \nfloat :floating-point number \ndouble :double precision floating-point number \nchar: character \n\n\n\nC++ defines two more: bool and wchar_t.\n\nbool: Boolean value, true or false \nwchar_t: wide character
674903
good answers, but there can also be multiple answers instead of just yes and no.\n\nfor instance, what day is today?\n\nif (day == monday)\n   cout<<"monday";\nelse if (day == tuesday)\n   cout<<"tuesday";\nelse if (day == wedensday)\n   cout<<"wedensday";\n...\nelse \n   cout<<"invalid entry";\n\nof course you could also use a case statement in this example, and would work the same.
223090
There is no such language: each language is good in some private case. People answering your question are glad to kill basic and fortran. But note that for simple, even primitive programs (when you want, e.g., quickly test some your idea) basic is a suitable one. Fortran has tons of scientific and engineering libraries and thus is widely used today. I, personally, do not like Pascal - but it is my own phobia :-)
440282
in c main can return void but not in c++\nin c++ it alsways return an int
963718
They could all potentially be valid C statements, depending on what functions and variables have already been defined.\n\nRawlyn.
781094
Nobody is going to do your homework for you. \n\nIf you're supposed to write code examples that illustrate how two comparable programs might look, then do this. Write some simple programs in C, and then re-write the same program in C++ but put the functions your void main calls in a class and instantiate the class.
659734
Null is used in program when a variable has no value, but can not be left blank or empty.  "Null" has a value - but it is nothing.  It is possible to make "if" statements based on the "null" value.  It can be used to prevent errors in programs where an empty or blank variable would cause it to crash.
775271
if this is a .c file, then the reason is that you have declared local variables AFTER a function call.  This is legal in c++ but not in c.\n\nswap the printf and char lines and it should work.