Click here to Skip to main content
13,736,246 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I want to print the string which is larger like small document but I can not store all the string because the char type range is up to 256. is there any way to display?

What I have tried:

I am new to c programming .. i don't know how to proceed.. i thought can i use structures?
Posted 28-Oct-17 2:04am
Updated 28-Oct-17 4:13am
Comments
Richard MacCutchan 28-Oct-17 9:06am
   
Your question is not clear, please edit your question and add some more detail.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

A string is made up of char values: it is an array of chars, normally terminated by a null character.
While each character can be only in the range of 0 to 255 inclusive (unless your embedded system implements Unicode, which seems unlikely) there is no such restriction on the size of the array - it's size is limited only by the size of an array index in your embedded system (normally 32 bit integers these days, but may be 16 bit in much older systems).

The only thing you can't do is store the length of the string (if any) in a single character - but as long as you keep that in an integer, you should be fine.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web06-2016 | 2.8.180920.1 | Last Updated 28 Oct 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100