Linked Questions

0 votes
2 answers
2k views

I have a simple program and I'm trying to write a sequence of hex values of byte patterns to a text file in the following format: arbitrary data representation 3f 42 5c b8 d9 0a // etc... Here is my ...
Francis Cugler's user avatar
0 votes
1 answer
2k views

I have a program that takes a string. Using the check() function that calculate the sum of all the value in the string of integers, I make additional computations, aka ss. The issue comes when I try ...
Kibill's user avatar
  • 1
0 votes
2 answers
128 views

Below is what I currently have; I am not sure why I cannot just print the value, incrementally with the below; i.e. 1,2,3.. etc. I have also tried cout<<count; #include <iostream> ...
Lieutenant Dan's user avatar
0 votes
2 answers
97 views

void onMouse(int event, int x, int y, int flags, void* param) { // Mat *pMat = (Mat*)param; // Mat image = Mat(*pMat); Mat image(512, 512, CV_8UC3, Scalar(255, 255, 255)); Vec3b planes = ...
Sean's user avatar
  • 329
0 votes
0 answers
475 views

how to convert in c++ int value to 4 byte representation. I tried in that way: int digit = 2; unsigned char a[4]; a[3] = (digit>>24) & 0xFF; a[2] = (digit>>16) & 0xFF; a[1] = (...
Robert's user avatar
  • 337
-2 votes
1 answer
192 views

I mean only main function. I dont understand int(c) when(when is not part of the code) c is char. How doeas it work? #include <iostream> using namespace std; int main() { char c; cout <<...
Sosos Sojowy's user avatar
0 votes
2 answers
126 views

I have been learning about pointers in C/C++ since quite few days and wanted to execute the following code. #include <iostream> using namespace std; int main(){ int x = 1025; int *p = &...
Ferrocene's user avatar
1 vote
2 answers
116 views

I have two char arrays A and B. I want to perform bitwise xor on these two arrays. But the output shows a garbage value. Where am I going wrong? I tried typecasting the output in char since array A ...
user avatar
1 vote
1 answer
79 views

When running this code: #include <iostream> using namespace std; int main() { // Signed char signed char signedCharValue = -10; cout << "Signed char: " << ...
mtk's user avatar
  • 13
1 vote
0 answers
59 views

I read a file with std::ifstream into an std::vector< char >, and would like to print each char as a hexadecimal value. I can do this with printf but would prefer to do it with std::cout in an ...
z32a7ul's user avatar
  • 3,847
267 votes
15 answers
464k views

#include <iostream> struct a { enum LOCAL_A { A1, A2 }; }; enum class b { B1, B2 }; int foo(int input) { return input; } int main(void) { std::cout << foo(a::A1) << std::endl; ...
BЈовић's user avatar
  • 64.7k
134 votes
16 answers
165k views

Left and right shift operators (<< and >>) are already available in C++. However, I couldn't find out how I could perform circular shift or rotate operations. How can operations like "Rotate ...
34 votes
4 answers
43k views

I'm trying to learn to code using intrinsics and below is a code which does addition compiler used: icc #include<stdio.h> #include<emmintrin.h> int main() { __m128i a = ...
arunmoezhi's user avatar
  • 3,240
22 votes
4 answers
40k views

I have something like: int8_t value; value = -27; std::cout << value << std::endl; When I run my program I get a wrong random value of <E5> outputted to the screen, but when I run ...
Grammin's user avatar
  • 12.3k
16 votes
3 answers
19k views

Issue I'm getting no output from a simple cout, whereas a printf will always print the number: std::cout << variableuint8; // prints nothing printf("%u", variableuint8); // prints the number ...
Adam Davis's user avatar
  • 93.9k

15 30 50 per page