Thread: Split a string in "substrings"

  1. #1
    Registered User
    Join Date
    Jan 2021
    Posts
    3

    Split a string in "substrings"

    For a CBC encryption homework, i have to split my main string in smaller equal strings of 16 chars each. Is there any specific method to that ? And if so how can i do it ?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Just work with 16 characters at a time. It wouldn't be a null terminated string, but you probably don't need that for encryption.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A "Simple" Array/String Problem. "Help" ASAP needed
    By AirulFmy in forum C Programming
    Replies: 10
    Last Post: 08-19-2015, 04:30 AM
  2. Help with writing a program to "split" a string
    By tmd2 in forum C Programming
    Replies: 38
    Last Post: 02-20-2011, 07:20 PM
  3. Replies: 46
    Last Post: 08-24-2007, 04:52 PM

Tags for this Thread