The null character, abbreviated NUL, is a control character with the value zero.
Questions tagged [null-character]
101 questions
0
votes
0 answers
ngx json viewer displays null characters as white space. How to I display it as a null character: [ \u0000 ]?
A null character (signified by unicode: "\u0000") appears in NGX json viewer as a white space.
Is there a way to show it as the unicode ("\u0000") instead, within the NGX json viewer?
In this example the null character is seen in both ways (space…

Zephram
- 499
- 3
- 7
- 16
0
votes
1 answer
What is meant by "number of characters extracted" in the std::ifstream gcount doc?
It is said in the documentation of the ifstream::getline method that:
The number of characters successfully read and stored by this function can be accessed by calling member gcount. https://cplusplus.com/reference/istream/istream/getline/
In any…

Hyena
- 87
- 8
0
votes
0 answers
How to prevent my code to count `\0` as one character?
I'm attempting to make strlen in C standard library on my own.
Following is my code and the strlen func I made is given the name mystrlen in the script below.
#include
//int mystrlen(const char* str);
int mystrlen(const…

XYJ
- 11
- 5
0
votes
1 answer
unix2dos command failed because of ^@ symbol present in the file
I'm facing below issue when performing unix2dos conversion
unix2dos: Binary symbol found at line 166
unix2dos: Skipping binary file Sample.txt
I can find ^@ characters in the file.
I can do -f which is force conversion of binary files
Any idea…

Prasanth
- 1
0
votes
3 answers
How does the function Strrchr finds the last c if c == '\0'?
Given for example a char *p that points to the first character in "there is so \0ma\0ny \0 \\0 in t\0his stri\0ng !\0\0\0\0",
how would Strrchr() find the last occurrence of null-character?
the following questions arises:
=>What conditions would it…

interesting
- 149
- 1
- 10
0
votes
1 answer
Why is c++ treating the space bar as null ('\0')?
my professor asked us to determine the number of vowels in userString without a call to the library.
I am using '\0' in a for loop to figure out when will the string the user input will come to an end because I don't know the exact size they are…

Mian Jalal
- 1
- 2
0
votes
1 answer
C++ Null characters in string?
I want to read a txt file and convert two cells from each line to floats.
If I first run:
someString = someString.substr(1, tempLine.size());
And then:
std::stof(someString)
it only converts the first number in 'someString' to a number. The rest…

Viktor Ingemarsson
- 46
- 3
0
votes
1 answer
C++ Writing to file with an unwanted null character inside the pathname
i fell on this singular issue:
i have to write to a txt file on a path that is like "C:....\0-myfolder\subfolder\file.txt",
where '0-myfolder' is the entire name of the folder
writing it as a normal path with double backslashes doesn't work because…

Giovanni D.C.
- 3
- 2
0
votes
2 answers
How do I feed a byte array with null characters into a std::iostream?
I have to feed a byte array, which contains null characters, into a derivative of std::iostream. The raw data looks as follows:
FF 73 00 05 73
I stored this chunk of data into a char array:
char *tmc_command = new char [5]; // array size may…

Neppomuk
- 1,102
- 1
- 11
- 24
0
votes
3 answers
Iterate through an array of characters in C
Recently I saw this while loop condition in C in the example below but I have no idea what the while condition really means and how the compiler knows when it is done. Could someone explain it to me?
This is what I believe it means: while loop…

TraineeGuy
- 81
- 1
- 7
0
votes
1 answer
what is the output this null character printing?
I am expecting a blank space for the printf("%c",i) while its clearly returning a value after the evaluation of the statement, So I think it should print a blank like or some other value for that matter as it's not null string it's null…

wabavid
- 11
- 4
0
votes
1 answer
Remove null Char from String after convert Byte() to String in VB.net
I have a string which comes from a dll. Supposedly, the string is converted from Byte() in the dll.
Below is snippet for how I get value from dll :
'DLL declare : Public Function getData(boolData as Boolean, strData1 as String, strData2 as…

MABY
- 1
- 3
0
votes
3 answers
Unexplainable behaviour when printing out strings in C
The following code works as expected and outputs ABC:
#include
void printString (char toPrint [100]);
int main()
{
char hello [100];
hello[0] = 'A';
hello[1] = 'B';
hello[2] = 'C';
hello[3] = '\0';
…

gnidoc
- 47
- 7
0
votes
1 answer
How to remove null characters at the end of a user input string?
I have an array of 20 strings with a maximum of 81 characters that will be populated by the user, how do I go about removing the excess null characters at the end should the users input be > 81 characters?
I've tried to search for solutions to this,…

cVos
- 27
- 1
- 5
0
votes
1 answer
How to save "Hex Data" to a file (ASCII) in CAPL including the "NULL" character (0x00)?
In CAPL code, I have a "byte[]" array, this array is supposed to hold "Hex" values (00..FF).
The problem is that, when I try to save the "Hex" array to a file in "ASCII" format, it completely ignores "00" (which is the "NULL" character) resulting in…

M. Moore
- 11
- 2