Adobe Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

during function calls, first parameters gets stored on the stack from right to left(the reason for parameter expression to executes from right to left in a function call)and then return address will store.
we have poiner to the const char format(ex: "name = %s, marks = %f")
so just parse this string and werever u get the % specifire, then use the subsequent memory location after the variable which points to this format

thats the actual way(AS I THINK) the variable number arguments works

- mail2vcp@gmail.com September 29, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

something like:
void myprintf(char *fmt, ...)
{
//va_list arg;
char *pArg;

//va_start(arg, fmt);
pArg = (char *)&fmt;
pArg += sizeof(fmt);

do{
...
//i = va_arg(arg, int);
i = *((int*)pArg);
pArg += sizeof(int);
...
} while(*fmt);

//va_end(arg);
pArg = NULL;
}

- Ada March 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

corrections:
1. pArg = fmt (already a pointer)
2. pArg+=strlen(fmt)+1 (its a string and not an array)

rest seems quite ok... good sol

- fabregas March 07, 2011 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More