What will be output of following program?
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main()
{
char *ptr1 = NULL;
char *ptr2 = 0;
printf("\n%d", ptr2);
strcpy(ptr1, "c");
strcpy(ptr2, "questions");
printf("\n%s %s", ptr1, ptr2);
getch();
}
#include <stdio.h>
#include <conio.h>
#include <string.h>
int main()
{
char *ptr1 = NULL;
char *ptr2 = 0;
printf("\n%d", ptr2);
strcpy(ptr1, "c");
strcpy(ptr2, "questions");
printf("\n%s %s", ptr1, ptr2);
getch();
}
printf("\n%d", ptr2);
strcpy(ptr1, "c");
strcpy(ptr2, "questions");
printf("\n%s %s", ptr1, ptr2);
Hãy suy nghĩ và trả lời câu hỏi trước khi xem đáp án
Tổng hợp câu hỏi trắc nghiệm lập trình C/C++ có đáp án và lời giải đầy đủ nhằm giúp các bạn dễ dàng ôn tập lại toàn bộ các kiến thức.