Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /********************************************************/
- #define MAX 200
- /********************************************************/
- int readCommands( char c [ ] );
- /********************************************************/
- int main( void ) {
- char commands[ MAX ] = { 0 };
- int ncmds;
- int count;
- ncmds = readCommands( commands );
- printf("Array begings\n");
- for(count = 0;count<ncmds;count++){
- printf("%c\n",&commands[count]);
- }
- printf("ncmds:%d\n",ncmds);
- return 0;
- }
- /***********************************************************/
- int readCommands( char commands[] ) {
- int ncmds = 0;
- char val;
- while(fscanf(stdin, "%c",&val) != EOF){
- commands[ncmds] = val;
- ncmds++;
- }
- return ncmds;
- }
- /*************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement