char

char * to NSData to display in UIImageView

I am getting image data in form of char * (stored on sql server). I want to convert those data to NSData to display image in UIImage view. char * data is a bytearray for source image. how can i convert char * to NSData to display to get an UIImage instance for displaying in UIImageView? Thanks.. ...

Storing an integer into a char* in C++

I'm writing some code that returns an integer, which then needs to be outputted using printw from the ncurses library. However, since printw only takes char*, I can't figure out how to output it. Essentially, is there a way to store a integer into a char array, or output an integer using printw? ...

[java] String can't change. But int, char can change.

I've read that in Java an object of type String can't change. But int and char variables can. Why is it? Can you give me an example? Thank you. (I am a newer -_- ) ...

How to convert accented letters to regular char in Java

How do I convert Æ and á into a regular English char with Java ? What I have is something like this : Local TV from Paraná. How to convert it to [Parana] ? ...

Passing a char** into a function by reference

Season's greetings! I have a function that prints out the contents of a char** that is being used as an array to store a number of strings. The is declared like this: char** commandArray = (char**)malloc(historySize); where historySize is a global int set to 8, for now. The array is populated with commands that the user enters, in s...

Comparison of character in C literal string.

Hi, The following program does not work as I intended. #include <string.h> #include <stdio.h> int main() { const char *c = "abcdef"; // prints 'f' as expected printf("%c\n", c[5]); // comparison fails, does not print "yes" if (c[5] == 'f') printf("yes"); return 0; } How can I compare a character in ...

VARCHAR(x) - Does setting a length turn it into "fixed-length" in MySQL performance terms?

I understand the differences between CHAR and VARCHAR, one being fixed-length and the other variable-length, and that if all fields in a row are fixed-length, a table will generally perform better. However, something that is unclear to me is that if I give VARCHAR a length, such as VARCHAR(500), does this retain the row as fixed-length?...

C#: How to assign a Character using ASCII data?

In C#: How do I store an ASCII character to a "char" literal? The ASCII character I want to use for my special character is the File Separator symbol: Decimal: 028 Octal: 034 Hex: 01C Binary: 00011100 // This works in C/C++, but not C#: static const char FS = 0x1C; // File Separator ...

stick integer to string and char*

Dear all, How can I add an integer variable to a string and char* variable? for example: int a = 5; string St1 = "Book", St2; char *Ch1 = "Note", Ch2; St2 = St1 + a --> Book5 Ch2 = Ch1 + a --> Note5 Thanks ...

Issue with char[] in VS2008 - why does strcat append to the end of an empty array?

I am passing an empty char array that I need to recursively fill using strcat(). However, in the VS debugger, the array is not empty, it's full of some weird junk characters that I don't recognise. strcat() then appends to the end of these junk characters rather than at the front of the array. I have also tried encoded[0] = '\0' to clea...

Issue with char array of size one and strcat

Ok, I'm really confused by this behaviour in VS2008. This code.. char data[512] = ""; char c[1] = ""; c[0] = '1'; strcat(data, c); .. results in data being set to this string value: 1ÌÌÌÌhÿ Surely it should just be 1? How can I ensure data only contains the single char[] that I copy into it (i.e. 1)? Why does strcat() copy all t...

Which is faster: char(1) or tinyint(1) ? Why?

Hi all, MY PLATFORM: PHP & mySQL MY SITUATION: I came across a situation where I need to store a value for user selection in one of my columns of a table. Now my options would be to: Either declare the Column as char(1) and store the value as 'y' or 'n' Or declare the Column as inyint(1) and store the value as 1 or 0 This column so...

keeping track of how much memory malloc has allocated

After a quick scan of related questions on SO, I have deduced that there's no function that would check the amount of memory that malloc has allocated to a pointer. I'm trying to replicate some of std::string basic functionality (mainly dynamic size) using simple char*'s in C and don't want to call realloc all the time. I guess I'll need...

boost memorybuffer and char array

Hello, I'm currently unpacking one of blizzard's .mpq file for reading. For accessing the unpacked char buffer, I'm using a boost::interprocess::stream::memorybuffer. Because .mpq files have a chunked structure always beginning with a version header (usually 12 bytes, see http://wiki.devklog.net/index.php?title=The_MoPaQ_Archive_Format#2...

char is signed or unsigned by default

In the book "Complete Reference of C" it is mentioned that char is by default unsigned. But i am trying to verify this with GCC as well as visual studio. It is taking it as signed by default. which one is correct ...

How to reverse String.fromCharCode ?

String.fromCharCode(72) gives H. How to get number 72 from char H? ...

Converting a Char to Its Int Representation

I don't see this an option in things like sprintf(). How would I convert the letter F to 255? Basically the reverse operation of conversion using the %x format in sprintf? I am assuming this is something simple I'm missing. ...

MySQL - TEXT vs CHAR and VARCHAR

Reading this question a doubt poped into my head: char and varchar can store up to 255 chars text can store up to 65k chars char size in bytes is number of chars varchar size in bytes is number of chars used + 1 So how much bytes does TEXT actually occupies? ~65kb or number of chars used + 1? ...

trying to copy a char pointer using memcpy, getting an error

so I want to copy a char pointer, asked a friend and he said to use memcpy... so I am trying to do this: charFilenameAndPath=strtok(filename,"."); memcpy=(charFilename,charFilenameAndPath, sizeof(charFilenameAndPath)); and the compiler is spitting out this: uTrackSpheres.cpp:176: error: assignment of function ‘void* memcpy(void*, co...

Converting System::String to Const Char *

I am using Visual C++ 2008's GUI creator to make a user interface. When a button is clicked, the following function is called. The content is supposed to create a file and name the file after the contents of the textbox "Textbox' with '.txt' at the end. However, that leads me to a conversion error. Here is the code: private: System::Vo...