Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
scope q
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Frank Silvermann, post: 2466941"] I have taken an extraordinary leap into the modern world by purchasing webspace. In addition to my private concerns, I would like to make a part to which others, e.g. my nieces and ex-wife, can ftp. To keep a hold of the reigns, I shall write a program that changes the password, and the brains of this prog will be in C: #def MIN_WORD_LENGTH 9 #def MAX_WORD_LENGTH 15 /* subroutine for random permutation */ void permute(char *, int) /* main char p[] = "abcdefghijklmnopqrstuvwxyz"; char q[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char r[] = "0123456789"; void swap(char *, char *); end main */ void permute(char *m , int n) { ; } void swap(char *a, char *b) { char c; c = *a; *a = *b; *b = c; } /* end pseudosource */ I'm going to build a word from p, q and r. At this point, I have 2 questions: 1) Does the scope look right? I've got the subroutine at file scope and the swap at block scope. If I make a call to swap from within permute(), is every ISO compiler going to know what I'm talking about? 2) Is it foolhardy of me to think that I can permute a string given its pointer and length, without needing any information back, hence the void declaration? frank ------- [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
scope q
Top