7 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
51
views
Escape Character's unusal behavior
I'm getting an unintended output from this code.
int main() {
int var;
while ((var = getchar() ) != '\n') {
if (var == '\t')
printf("\\t");
if (var ...
1
vote
3
answers
1k
views
What does '9' mean in C? [duplicate]
When writing '9' instead of 9 as my char c my endresult becomes negative and wrong for some reason. Why is that? What does '9' do?
#include <stdio.h>
int main() {
int a, b;
char c = '9';...
1
vote
1
answer
1k
views
How to compile the extended character in C++ using GCC?
The following code fails to compile using GCC:
int main()
{
for(int j=0; j<80; j++) //for every column,
{ //ch is ‘x’ if column is
char ch = (j%8) ? ‘ ‘ : ‘x’; //multiple of 8, and
...
1
vote
0
answers
37
views
Ascii immediate in gas? [duplicate]
Is there a way to enter in a character as an immediate in gas? For example:
mov 1,ドル %rax # decimal
mov 0ドルxA, %rbx # hex
mov 0ドルb100, %rcx # binary
mov 'A', %rdx # something like this?
I know I ...
0
votes
3
answers
185
views
How does C language transform char literal to number and vice versa
I've been diving into C/low-level programming/system design recently. As a seasoned Java developer I still remember my attemtps to pass SUN Java Certification and questions if char type in Java can be ...
1
vote
2
answers
460
views
How do C++ compiler interpret comparison logic in string/character?
When we compare numbers in a string/character format, how does the c++ compiler interpret it? The example below will make it clear.
#include <iostream>
using namespace std;
int main() {
// your ...
5
votes
5
answers
1k
views
Is int x = 'fooo' a compiler extension?
I have seen and used C++ code like the following:
int myFourcc = 'ABCD';
It works in recent versions of GCC, not sure how recent.
Is this feature in the standard?
What is it called?
I have had ...