Click here to Skip to main content
15,894,825 members
Home / Discussions / Article Writing
   

Article Writing

 
GeneralAntialiasing Pin
14-May-01 7:49
suss14-May-01 7:49 
GeneralProgramming Problem Pin
mvworld14-May-01 4:04
mvworld14-May-01 4:04 
GeneralRe: Programming Problem Pin
Thomas Freudenberg14-May-01 5:22
Thomas Freudenberg14-May-01 5:22 
GeneralRe: Programming Problem Pin
mvworld14-May-01 5:34
mvworld14-May-01 5:34 
GeneralRe: Programming Problem Pin
Thomas Freudenberg14-May-01 5:40
Thomas Freudenberg14-May-01 5:40 
GeneralRe: Programming Problem Pin
mvworld14-May-01 5:47
mvworld14-May-01 5:47 
GeneralRe: Programming Problem Pin
Thomas Freudenberg14-May-01 6:07
Thomas Freudenberg14-May-01 6:07 
GeneralNot difficult. Pin
16-May-01 10:47
suss16-May-01 10:47 
This is trivial. Either that or I don't understand the problem.

Your requirements:
Store variable arguments of different types at runtime.

Type is irrelevant. It will all be ascii at first.
Then you detect your types and convert them. See,
since YOU write the program, YOU decide the types.

The arguments will be in char **argv and the number of them
will be int argc. Write code to print out the
value of argc. When that works, modify it to
also print the argument strings, one by one.

You are 90 percent finished. Now for the other 90 percent... Smile | :)

Modify your code so that, instead of printing
the arguments, you are PARSING them. First, decide
which types you will support. Start with int and char strings.
For each argument string, check each character.

If you get to the end and find only digits, you have an int.
Call atoi() on it and store it in a freshly newed int.
Be careful of overflow - might wanna use longs and atol().

If it wasn't an int, it's a character string.
New up a buffer and strcpy it over.

To add another type, you must invent a way to detect
the type and then you must find a way to convert the
ascii string to your desired type.



GeneralRe: Programming Problem Pin
David Fleming17-May-01 23:02
David Fleming17-May-01 23:02 
GeneralRe: Programming Problem Pin
mvworld17-May-01 23:15
mvworld17-May-01 23:15 
GeneralRe: Programming Problem Pin
19-Jun-01 16:15
suss19-Jun-01 16:15 
GeneralRe: Programming Problem Pin
mvworld26-Jun-01 4:20
mvworld26-Jun-01 4:20 
GeneralRe: Programming Problem Pin
Malcolm McMahon26-Jun-01 3:09
Malcolm McMahon26-Jun-01 3:09 
Generalvector, deque class template Pin
Heidyen13-May-01 16:31
Heidyen13-May-01 16:31 
GeneralRe: vector, deque class template Pin
Christian Graus13-May-01 17:59
protectorChristian Graus13-May-01 17:59 
GeneralRe: vector, deque class template Pin
Clinton James16-May-01 9:01
Clinton James16-May-01 9:01 
GeneralCreate a file name with date&time Pin
12-May-01 14:30
suss12-May-01 14:30 
GeneralRe: Create a file name with date&time Pin
Rick York12-May-01 16:42
mveRick York12-May-01 16:42 
GeneralRe: Create a file name with date&time Pin
14-May-01 14:15
suss14-May-01 14:15 
QuestionXML on Client Side??? Pin
12-May-01 4:37
suss12-May-01 4:37 
GeneralLooking for Capable Programmers... Pin
10-May-01 16:19
suss10-May-01 16:19 
QuestionTabbed Toolbar - How? Pin
10-May-01 8:46
suss10-May-01 8:46 
QuestionHow to access ActiveX control in another thread Pin
9-May-01 23:17
suss9-May-01 23:17 
QuestionHow to access ActiveX control in another thread Pin
9-May-01 23:16
suss9-May-01 23:16 
GeneralScrolling the window content Pin
Mangesh Sardesai8-May-01 21:34
Mangesh Sardesai8-May-01 21:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.