scanf « string « C Array Q&A

Home
C Array Q&A
1.bit
2.Byte
3.char
4.class
5.Development
6.Dimensional Array
7.dynamic
8.element
9.find
10.index
11.initialization
12.Integer
13.length
14.loop
15.memory
16.Operation
17.pointer
18.Print
19.size
20.Sort Search
21.string
22.struct
23.variable
C Array Q&A » string » scanf 

1. Scanf erases a char array unwillingly    stackoverflow.com

See the following program:

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>

main(void){
  printf("Array concatenateor\n-------------------------\n");

  //declarations
  char s1[50],s2[50],s3[50];
  short int n=0;

  //Array initialisation
  printf("Array 1: ");
  gets(s1);
  printf("Array ...

2. Please help: counting string occurances using scanf and arrays    cboard.cprogramming.com

Goal: count the number of unique strings from the input stream. The typedef, STRING, scanf, and %s are required. After that, sort each unique string according to how many times its appeared. The output of the program should look like: word3 6 //word3 has appeared 6 times word1 3 //word1 has appeared 3 times word4 2 word4 has appeared 2 times ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.