Subjects
PRICING
TEST PREP
SIGN IN
Start Free Trial
Vivek S.
Tutor for 5 years
Tutor Satisfaction Guarantee
Python Programming
TutorMe
Question:

What is the type of sys.argv?

Vivek S.
Answer:

It is a list of elements.

Computer Science (General)
TutorMe
Question:

What are dangling pointers?

Vivek S.
Answer:

A dangling pointer points to memory that has already been freed. The storage is no longer allocated. Trying to access it might cause a Segmentation fault. Common way to end up with a dangling pointer: char* func() { char str[10]; strcpy(str,"Hello!"); return(str); } //returned pointer points to str which has gone out of scope. You are returning an address which was a local variable, which would have gone out of scope by the time control was returned to the calling function. (Undefined behaviour) Another common dangling pointer example is an access of a memory location via pointer, after free has been explicitly called on that memory. int *c = malloc(sizeof(int)); free(c); *c = 3; //writing to freed location!

C Programming
TutorMe
Question:

What will be output if you will compile and execute the following c code? struct marks{ int p:3; int c:3; int m:2; }; void main(){ struct marks s={2,-6,5}; printf("%d %d %d",s.p,s.c,s.m); }

Vivek S.
Answer:

2 2 1 Explanation: Binary value of 2: 00000010 (Select three two bit) Binary value of 6: 00000110 Binary value of -6: 11111001+1=11111010 (Select last three bit) Binary value of 5: 00000101 (Select last two bit)

Send a message explaining your
needs and Vivek will reply soon.
Contact Vivek
Ready now? Request a lesson.
Start Session
FAQs
What is a lesson?
A lesson is virtual lesson space on our platform where you and a tutor can communicate. You'll have the option to communicate using video/audio as well as text chat. You can also upload documents, edit papers in real time and use our cutting-edge virtual whiteboard.
How do I begin a lesson?
If the tutor is currently online, you can click the "Start Session" button above. If they are offline, you can always send them a message to schedule a lesson.
Who are TutorMe tutors?
Many of our tutors are current college students or recent graduates of top-tier universities like MIT, Harvard and USC. TutorMe has thousands of top-quality tutors available to work with you.