What is wrong with the following code?
int *foo()
{
int *s = malloc(sizeof(int)100);
assert(s != NULL);
return s;
}
Answer Posted / susie
Answer : & Explanation:
assert macro should be used for debugging and finding out
bugs. The check s != NULL is for error/exception handling
and for that assert shouldn’t be used. A plain if and the
corresponding remedy statement has to be given.
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
how to test pierrot divisor
why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?
Cluster head selection in Wireless Sensor Network using C programming language.
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
#include
How to palindrom string in c language?
Write a program to model an exploding firecracker in the xy plane using a particle system
Write a routine to implement the polymarker function
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
write a program for area of circumference of shapes
What is full form of PEPSI