Question about char

This is a discussion on Question about char within the C Programming forums, part of the General Programming Boards category; Hello! i have a problem. I need a function that adds number at the begining of char, so that the ...

  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
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,498
    Use a data structure, like a queue.
    (There are plenty of available information about how to implement them.)
    Manasij Mukherjee | gcc-4.8.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,300
    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: 11-30-2008, 11:45 PM
  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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21