🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #1989

Re: Good C Interview ques

#1989
From: Martin Ambuhl
Date: Thu, 15 Feb 1996 15:04
26 lines
1369 bytes
jxh@plethora.cs.wustl.edu (James Hu)
in <4fu7ro$97o@solutions.solon.com> wrote:

[snip]
>Here's a question:

>Write a function which converts a number from an arbitrary base between
>2 and 9 to base 10.  Assume the input is a valid number in the input
>base, and the base is always between  2 and 9.
>/* spec: */ int convert(int number, int base);

I must admit not having the slightest idea what this question means,
since the input int and the output int are base 2 on a binary machine.

A function with a prototype
    int convert(char *outputString, const char *inputString, int base);
with the return value being a completion code makes more sense to me.
But since this is trivial with standard C functions, it would serve only
as a rudimentary screening question.


[snip]
                                                                                                                     
--
* Martin Ambuhl       net: mambuhl@ripco.com
* Chicago, IL (USA)    
Technical Details
Message-ID: <4fvi2d$ea5@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: mambuhl@ripco.com (Martin Ambuhl)
Newsgroups: comp.lang.c.moderated
Subject: Re: Good C Interview ques
Date: 15 Feb 1996 09:04:45 -0600
Organization: Ripco Communications, Inc.
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4fvi2d$ea5@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com