User loginNavigationTake FREE online C/C++ test now!Unix / Linux ProgrammingCode search made simpleYour feedback needed!As a webmaster of this site, I regard you as our most important critic and commentator. We value your opinion and want to know what we are doing right, what we could do better and any other words of wisdom you're willing to pass our way. It would be our greatest motivation which will help us in developing areas you would like to see in this site. We hope you will continue to encourage and support us in our future endeavors.
INDIA |
InterviewInterview Questions & Resources. [JOB] Strong programming experience with C/C++ on UNIX - Opening at Sun Microsystems India, BangaloreJob Summary The Sustaining Engineering team is seeking a talented, creative, highly-motivated Software Engineer to develop and sustain Messaging Server and Calendar Server products. Job Description
Never mix malloc with delete OR new with freeNever mix malloc with delete OR new with free as the outcome will be undefined behavior. It is not a good programming practice.Let's look at the two undefined behavior due to the mixed usage of malloc with delete OR new with free and learn how to overcome it: * malloc with delete (attached mallocdel.cpp) - In this case, memory is allocated with malloc and it is freed using delete or delete[].
TUTORIALS @ c4swimmers.net
C, C++, Unix TUTORIALS @ c4swimmers.net
Job Opening: QA Manager - Software TestingDear c4swimmers, We have some urgent requirements with our Client in India. About Client: It’s a Fortune 25 top Software MNC with Multiple offices across USA, UK and India. If you feel you are fitting to any of position below send your updated resume, and contact details to swiftsol.consultant@gmail.com Position: Manager – Quality Engineering Job Experience: 8 - 15 yrs in software QE
Reading from a dangling pointer
/*
* File: readdangling.c
*/
#include<stdio.h>
#include<stdlib.h>
int main()
{
char str;
char *strptr = (char *) malloc(10 * sizeof(char));
free(strptr);
str = *strptr;
return 0;
}
Note: The problem with this code snippet occurs when an attempt is made to dereference a pointer that points to a block of memory that has been freed. This type of problem is commonly known as "Reading from a dangling pointer". Solution: Ensure that the pointer you are using should really be pointing to an allocated block at the indicated place.
|