char

char array assignment and management

I'm supposed to write a library in c++ that should handle the connections to the kad network. I'm trying to build a packet accordant to those used by aMule&co. And I really can't understand the difference between this code: buffer = "\xe4\x20\x02"; and, for example, this code: char p_buffer[36]; p_buffer[0] = 0xe4; p_buffer[1] = 0x2...

Call a selector that takes a char* from PyObjC

I'm trying to use a private framework with PyObjC. I've got this so far: from AppKit import * from Foundation import * import objc framework="/System/Library/PrivateFrameworks/DSObjCWrappers.framework" objc.loadBundle("DSObjCWrapper", globals(), framework) directory = DSoDirectory.alloc() directory.initWithHost_user_password_("server...

Error passing 2D char* array into a function.

I'm trying to pass a 2D array of char* into a function. I am getting this error: "cannot convert 'char* (*)[2]' to 'char***' for argument '1' to 'int foo(char***)'" Code: int foo(char*** hi) { ... } int main() { char* bar[10][10]; return foo(bar); } ...

Getting an ascii character code in ruby - ? fails

I'm in a situation where I need the ASCII value of a character (for Project Euler question #22, if you want to get specific) and I'm running into an issue. Being new to ruby, I googled it, and found that ? was the way to go - ?A or whatever. But when I incorporate it into my code, the result of that statement is the string "A" - no chara...

Char array in a struct - incompatible assignment?

Hi! I tried to find out what a struct really 'is' and hit a problem, so I have really 2 questions: 1) What is saved in 'sara'? Is it a pointer to the first element of the struct? 2) The more interesting question: Why doesn't it compile? GCC says "test.c:10: error: incompatible types in assignment" and I can't figure out why... (This ...

C++ enum from char

Ok, I'm new at C++. I got Bjarne's book, and I'm trying to follow the calculator code. However, the compiler is spitting out an error about this section: token_value get_token() { char ch; do { // skip whitespace except '\n' if(!std::cin.get(ch)) return curr_tok = END; } while (ch!='\n' && isspace(ch)); ...

Thread safe char string in C

In C: If I have 3 threads, 2 threads that are appending strings to a global char string (char*), and 1 thread that is reading from that char string. Let's say that the 2 threads are appending about 8 000 strings per second each and the 3rd thread is reading pretty often too. Is there any possibility that they will append at exactly th...

.NET / C# - Convert char[] to string

Guess I have just never run across it before. What is the proper way to turn a char[] into a string? The ToString() method from an array of chars doesn't do the trick. Guess I had always imagined that was what it was for. ...

SQL query for a carriage return in a string and ultimately removing carriage return

SQL query for a carriage return in a string and ultimately removing carriage return I have some data in a table and there are some carriage returns in places where I don't want them. I am trying to write a query to get all of the strings that contain carriage returns. I tried this select * from Parameters where Name LIKE '%"\n" %' A...

Symbian character printing

I am attempting to construct a very simple proof of concept that I can write a web service and actually call the service from a symbian environment. The service is a simple Hello service which takes a name in the form of a const char* and returns back a greeting of the form "hello " + name in the form of a char*. My question is, how do I...

String losing data when assigning to TStringList

Hi there. I have this method, var s : TStringList; fVar : string; begin s := TStringList.Create; fVar := ZCompressStr('text'); ShowMessage( IntToStr(length(fVar) * SizeOf(Char)) ); //24 s.text := fVar; ShowMessage( IntToStr( length(s.text) * SizeOf(Char)) ); //18 end; The ZCompressStr is from http://www.base2ti.com/zlib.htm with...

How to convert NSString to char?

Hi, I'm trying to convert an NSString to a single char. When I write [[NSLocale] currentLocale] objectForKey:NSLocaleDecimalSeparator], I get @",". How can I convert this to ','? Thank you! ...

C compiler flag to ignore sign

I am currently dealing with code purchased from a third party contractor. One struct has an unsigned char field while the function that they are passing that field to requires a signed char. The compiler does not like this, as it considers them to be mismatched types. However, it apparently compiles for that contractor. Some Googling has...

What is the char that is displayed over hidden passwords?

If you type a password in a modern application, it usually displays a nice neat black circle - where more traditional app's would use an asterisk. How is that character created? Is it an ascii value (if so I can't find it)? If not, how is it created? ...

SQL Update varchar to date error

Hi I have a table with 5 million records of dates stored as char(10) with format yyyy/mm/dd. I need to convert these to datetime, so I use: UPDATE [Database].[dbo].[Table] SET [DoB]=convert(datetime,[DoBText],103) GO But I get the error: "The conversion of a varchar data type to a datetime data type resulted in an out-of-range...

How to make next step of a string. C#

The question is complicated but I will explain it in details. The goal is to make a function which will return next "step" of the given string. For example String.Step("a"); // = "b" String.Step("b"); // = "c" String.Step("g"); // = "h" String.Step("z"); // = "A" String.Step("A"); // = "B" String.Step("B"); // = "C" String.Step("G"...

Max Char in TextBox C#?

Just wondering how many char can C# Textbox multiline hold? ...

cast(val as char) in hibernate config named query

Hi I am facing data truncation issue with hibernate for DB2 Char datatype. I am getting only the first character for DB2 char datatype using hibernate. I looked through the net and got two threads with similar issues. These two threads mentions either to modify the dialect or cast as char in sql query. below are the two similar threa...

I'm new to C, can someone explain why the size of this string can change?

I have never really done much C but am starting to play around with it. I am writing little snippets like the one below to try to understand the usage and behaviour of key constructs/functions in C. The one below I wrote trying to understand the difference between char* string and char string[] and how then lengths of strings work. Furth...

Removing specific characters from a string in php

Hi How can I check a string in php for specific characters such as '#' or '\'? I don't really want to use replace, just return true or false. Thanks ...