character array to string

Discussion in 'C Programming' started by smjeffery, Mar 31, 2011.

  1. smjeffery

    smjeffery

    Joined:
    Mar 31, 2011
    Messages:
    1
    Is it possible to read characters from a file, store them into character array, then change the characters to string?
    So, let's say in the file, abc is written. I would store each letter 'a' 'b' 'c' into character array using fscanf.
    So the array would now contain {'a', 'b', 'c'}.
    However, I want them to be put in all together into a string.
    What I mean by that is, make 'a' 'b' 'c' into one word "abc".
     
    smjeffery, Mar 31, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Velvet
    Replies:
    9
    Views:
    14,837
    Joerg Jooss
    Jan 19, 2006
  2. Brand Bogard

    8 bit character string to 16 bit character string

    Brand Bogard, May 25, 2006, in forum: C Programming
    Replies:
    8
    Views:
    741
    those who know me have no need of my name
    May 28, 2006
  3. herman
    Replies:
    5
    Views:
    7,610
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=
    Aug 30, 2007
  4. PerlFAQ Server
    Replies:
    0
    Views:
    395
    PerlFAQ Server
    Jan 25, 2011
  5. Bart Vandewoestyne
    Replies:
    8
    Views:
    742
    Bart Vandewoestyne
    Sep 25, 2012
Loading...

Share This Page