char

why does this method return the same random string each time?

I need to create a block of unique lines to test a different project im working on. so i created a simple program to generate a random string of X length. The issue is that if i call it once i get a random string if i call it again (in a for loop for example I get the same string for the entire execution of the loop. I have a feeling ...

D2009 problems with array of char - how can I `elegantly` fix my code?

Going through some of my older Delphi projects and upgrading them to D2009, as I find this version a great improvement (Generics.Collections - wow! ;)) to all previous releases, I encounter various problems. This one I managed to solve but the solution does not seem half as elegant as I believe it could be. (Note, I haven't written Delph...

Casting an array of unsigned chars to an array of floats

Hi. What is the best way of converting a unsigned char array to a float array in c++? I presently have a for loop as follows for (i=0 ;i< len; i++) float_buff[i]= (float) char_buff[i]; I also need to reverse the procedure, i.e convert from unsigned char to float (float to 8bit conversion) for (i=0 ;i< len; i++) char_buff[i]...

How do you determine the length of an unsigned char*?

How do you determine the length of an unsigned char*? ...

SSIS Derived Column Expression for Boolean-to-Char CAST

Hello, I am having a bit of a struggle with Expressions inside SSIS Derived Columns. My source field is a BOOLEAN data type. It's destination field is a SQL CHAR datatype. ** Note that I did not design either of the schemas. If I had my way, the data types would match up. Unfortunately, this is not my case! I found a great example of...

How to convert char to integer in C?

Possible Duplicates: How to convert a single char into an int Character to integer in C Can any body tell me how to convert a char to int? char c[]={'1',':','3'}; int i=int(c[0]); printf("%d",i); When I try this it gives 49. ...

Convert array of char[] to byte[] and vice versa? C++

What is the best way to convert an array of chars to bytes and vice versa? Solution: void CharToByte(char* chars, byte* bytes, unsigned int count){ for(unsigned int i = 0; i < count; i++) bytes[i] = (byte)chars[i]; } void ByteToChar(byte* bytes, char* chars, unsigned int count){ for(unsigned int i = 0; i < count; i++) ...

Is char guaranteed to be exactly 8-bit long in C?

That's all. Didn't find any similar topic so bear with me it there is. ...

How to turn char a into b in vb.net

Hi i am trying to increment a char in vb.net, eg: Dim letter As Char = "a"c. and i want to make it b, and so on. how can i do this? ...

why is char's sign-ness not defined in C?

The C standard states: ISO/IEC 9899:1999, 6.2.5.15 (p. 49) The three types char, signed char, and unsigned char are collectively called the character types. The implementation shall define char to have the same range, representation, and behavior as either signed char or unsigned char. And indeed gcc define that accord...

assigning character to char pointer

With c-style strings, how do you assign a char to a memory address that a character pointer points to? For example, in the example below, I want to change num to "123456", so I tried to set p to the digit where '0' is located and I try to overwrite it with '4'. Thanks. #include <stdio.h> #include <stdlib.h> int main() { char* num ...

Appending ints to char* and then clearing

I'm working on a project using an Arduino and as such, I'm reading from a serial port (which sends ints). I need to then write this serial communication to an LCD, which takes a char*. I need to read several characters from the serial port (2 integers) into a string. After both have been received, I then need to clear the string to prep...

char array to LPCTSTR conversion in c

Does anyone know how to convert a char array to a LPCTSTR in c? Edit: For more reference, I need to add an integer to a string then convert that string to LPCTSTR for the first parameter of the windows function CreateFile(). This is the hardcoded example which I am currently using, but I need to be able to pass in any number to use as...

C++ - Convert FILE* to CHAR*

I found a C++ source file which calculates expressions from a command line argument (argv[1]), however I now want to change it to read a file. double Utvardering(char* s) { srcPos = s; searchToken(); return PlusMinus(); } int main(int argc, char* argv[]) { if (argc > 1) { FILE* fFile = fopen(argv[1], "r"); double Value = Utvard...

SSIS SQL char conversion to MS Access Yes/No field

I have an SSIS package I am developing. I am attempting to write data from SQL Server 2005 to MS Access 2007. I am pretty stumped on how to convert a SQL char(1) field to an Access Yes/No field. From the information I have gathered, the SQL equivalent of an Access Yes/No field would be a bit field, with values of either 0 or 1. My SQL...

How to find out next character alphabetically?

How we can find out the next character of the entered one. For example, if I entered the character "b" then how do I get the answer "c"? ...

Why aren't Array methods built into an Array instance?

Sorry for what is probably a silly question but it's bugging me... int[] i = {3, 2, 1}; //why Array.Sort(i); //instead of i.Sort(); char c = 'c'; //why char.IsLetter(c); //instead of c.Isletter(); ...

Calling C++ function from C#

Hello, I have a the following C++ function void FillAndReturnString(char ** someString) { char sourceString[] = "test"; *someString = new char[5]; memcpy(*someString, sourceString, 5); } It is declared as extern "C" { __declspec(dllexport) void __cdecl FillAndReturnString(char ** someString); } How do I call this func...

Is there a way to set ASP.NET TextBox password char when in Password TextMode?

Hi! <asp:TextBox TextMode="Password" runat="server" /> I want that when the user types in text, it should show • rather than a simple asterisk, is there a way (in win-forms' TextBox there is a property PasswordChar, what is it's similar in web)???? ...

Printing a char* in C++

I'm writing a simple program. There is only one class in it. There is a private member 'char * number' and two function (there will be more, but first these should work correctly :) ). The first one should copy the 'source' into 'number' variable (and I suppose somewhere here is the problem): LongNumber::LongNumber(const char * source ...