Ya ur point seems to be vaild.
realloc also does free....i checked it.
check the following link u can find source code for realloc
http://www.lua.org/source/src_lmem.c.html
Type: Posts; User: gotyatech
Ya ur point seems to be vaild.
realloc also does free....i checked it.
check the following link u can find source code for realloc
http://www.lua.org/source/src_lmem.c.html
Yes ,Realloc can be used to make memory area smaller.
But Realloc dosen't free the memory that was allocated earlier.
Memory can only be freed using free.
What is the exact reason for not using void main.
As far as i understand, people say int main should be used because a value should be returned to the OS.
But i think compiler dose take care of...
Before using qsort please check whether you have the libraray for that otherwise your program won't compile.
On unix it usually come as Fortran Library routine.
( library named as libF77.a ).
...
For inserting in between the string u need to take one more temp variable
Try this,
#include <string.h>
#include <stdio.h>
void main(void){
simple, try this
/* Here i is the position of where to copy the newstring into another string */
strcpy((another_string+(i-1)), newstring) ;
Here is simple code for sorting
#include<stdio.h>
int main()
{
int a[8] = {1,22,5,4,9,6,7};
Working in 'C'...why do u want one single command to sort....
implement any of the sorting algo.
linear sorting, quick sorting etc.
Thats the best way to learn.
I really didn't get the question.
What do u mean by "How do i allocate new memory blocks at runtime"....malloc does memory allocation at runtime. ????
For what do u want to alloacte new...
Hi Monster,
I appreciate the peice of code you wrote,
But i think there is no need of so many logical AND's.
the function p as follows will also work