Thread: Question about char

  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    10

    Question about char

    Hello!
    i have a problem.
    I need a function that adds number at the begining of char, so that the rest of the content moves one position forward. if it was (5 12 204 29 9) and when i add number 10, then after it, the comnet of char looks like (10 5 12 204 29 9)

    main problem is ... that i don't know how to do it. Could somebody please help me?

    Sorry for my bad english, hope you understand. If any questions, then ask

    Mursik ,.

  2. #2
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Use a data structure, like a queue.
    (There are plenty of available information about how to implement them.)

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    It sounds like the memmove function could help you here.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 'char' question
    By mattyg in forum C Programming
    Replies: 4
    Last Post: 12-01-2008, 12:45 AM
  2. char* question
    By Chaplin27 in forum C++ Programming
    Replies: 5
    Last Post: 08-14-2005, 09:23 PM
  3. Newb Question - Cant convert Char[41] to Char
    By Kalkran in forum C++ Programming
    Replies: 2
    Last Post: 08-19-2004, 10:05 AM
  4. char x[] question
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 07-16-2002, 04:41 AM
  5. c++ question about char
    By Mazer in forum C++ Programming
    Replies: 14
    Last Post: 07-15-2002, 07:12 PM