Questions tagged [chars]

a datatype that can hold a character of the implementation’s character set.

208 questions
1
vote
2 answers

jQuery - How to convert string from textbox to bytes?

i need to convert a string from a text field to bytes. How can i do that? Reason: The text on the textbox will be sent by SMS to the client, and I've limited the text to 160chars but if i put special chars like @€£‰¶÷‰‰€£@ it will be larger…
cusspvz
  • 5,143
  • 7
  • 30
  • 45
1
vote
1 answer

How to prevent the output of last comma character in line when writting to file

Maybe it's a very stupid question (I'm really noob with writing/reading/manipulate files) but I tried different method (found online and here on the site) but nothing worked :/ I have my matrix that is written in a file, and between each element of…
JEricaM
  • 794
  • 2
  • 15
  • 37
1
vote
2 answers

Trying to compare chars from matrix C

I'm tryingto compare chars from a matrix, but it's not adding any values and i don't know why so here's my code: #include #include #include #include #include #include #define MAX_LINES…
1
vote
4 answers

C programming language :if statements are not working correctly with characters

I'm trying to make this program say good but it says okay instead though I made the variable value the same of the if test value #include #include int main() { char history[200]; history == "NY school"; if(history…
1
vote
3 answers

Count number of chars excluding newlines

I'm using strlen() to count the number of chars in a text, but it even counts newline \n. Can i replace newlines is some way to make strlen() don't count them?
Antoder
  • 65
  • 2
  • 9
1
vote
1 answer

Why doesnt it replace the char?

The string "displayed" are filled with * and its just as long as the string "secret". and secret is a word from an array. public void replace(String input) { for (int j = 0; j < displayed.length(); j++) { if…
1
vote
2 answers

PHP is there a built-in function to render ' as ’ etc

is there a built-in function to render characters like ' as identities (’) ? also, is it unsafe to output raw characters (e.g ') in the html? thanks.
Gal
  • 23,122
  • 32
  • 97
  • 118
1
vote
4 answers

How to check what return functions and correctly calculate chars

Welcome. I have two problems. Firstly - function size bool (const char * pass) to check whether the amount of the chars inside of string is at least 8, but there is something wrong. Its always showing that there is minimum 8 chars, even is string…
Daniel Zawadzki
  • 179
  • 1
  • 7
1
vote
1 answer

Initializer-string for array of chars is too long error on Arduino

I am trying to run a code below on Arduino but when I verify the code, it shows, 'Initializer-string for array of chars is too long'. Although I have read previous questions regarding similar issues, I couldn't know where to begin in the code I am…
user2843746
  • 11
  • 1
  • 2
1
vote
2 answers

Ignore everything after '#'

So I'm trying to read in from a file. And if there is a '#' in the middle of a line, or anywhere for that matter, I want to ignore the rest of the line, and keep reading. This is what I have: while(getline(pgmFile, temp)) { istringstream…
Necrode
  • 51
  • 2
  • 7
1
vote
3 answers

Function not returning char correctly: error during compile

I am currently trying to write a simple Rock, Paper, Scissors program in C. The entire point of the assignment is to get familiar with using chars. Here is the code I currently have. It is incomplete, as I am stuck. #include int main() { …
1
vote
2 answers

Regular Expression, words with different characters

I have been searching about it for about 3 hrs, now I'm stuck. Here is the problem: I want to find 7 character word where only 4. and 6. chars are same like: ^...(.).\1.$ but i don't want to find aaaBaBa all other chars must different than each…
1
vote
1 answer

Qt Creator setInputMethodHints not work

my main goal right now is to forbid some chars entering in line edit.I want to forbid (!@#$%^&*()) chars, cause i do use SQL Database and someone can damage my database without filters for this chars.I tried to use setInputMask but in this way i can…
Rado G
  • 87
  • 1
  • 5
  • 14
1
vote
6 answers

C++ - How to convert char* to std::list

This is a beginner type of question I'm just wondering if there is a way to convert a null terminated char* to std::list. Thank you char* data = ... std::list clist = convert_chars2list(data); ... convert_chars2list(char* somedata) { …
Mohamed Tarek
  • 111
  • 4
  • 11
1
vote
2 answers

how to replace special chars in php

I have a code that i have to replace few special chars: code below: #include \012#include \012#include \012#include \012#include \012using namespace std;\012\012void…
Namiastka
  • 74
  • 9