Solved

How do I  convert Blob to Char

Posted on 2011-03-02
1
1,147 Views
Last Modified: 2012-05-11
How do I  convert Blob to Char in C
0
Comment
Question by:1030071002
1 Comment
 
LVL 32

Accepted Solution

by:
sarabande earned 500 total points
ID: 35026669
assuming the blob is already in a buffer (normally unsigned char). if the blob actually contains text you simply can cast the buffer and add terminating zero char.

   char * p;
   ...
   p = (char *)buffer;
   p[length_of_blob_in_bytes] = '\0';

note you need at least one extra byte for buffer to do so.

Sara



0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now