What is wrong with the following code?
int *foo()
{
int *s = malloc(sizeof(int)100);
assert(s != NULL);
return s;
}
Answer / 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 |
Write a program to receive an integer and find its octal equivalent?
Write a program that find and print how many odd numbers in a binary tree
Give a one-line C expression to test whether a number is a power of 2.
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }
pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.
6 Answers Fusion Systems GmbH,
main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
How to palindrom string in c language?
Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.
Write a single line c expression to delete a,b,c from aabbcc