Questions tagged [c++]

The tag has no usage guidance.

8 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Solve this c Problem

Implement a function in C to check whether the number is Armstrong or not. A positive integer is called an Armstrong number (of order n) if abcd... = a^n + b^n + c^n + d^n + ... where n is the number ...
  • 1
0 votes
1 answer
14 views

Can anyone tell me why this doesn't work?

#include using namespace std; int countDigit(int n) { int digits; while (n != 0) { n = n / 10; digits++; } return digits; } int main() { int number; cin >> number; int cycles = ...
0 votes
0 answers
90 views

Recover Assignment Memory Leak and Insufficient Recovery

I am trying to complete the assignment given by CS50x (Harvard Community Online, edX.org), and while it successfully recovers images, valgrind is telling me that there are memory leaks that happen in ...
0 votes
1 answer
63 views

CS50 PSet 4 Recover, Segmentation Fault

My code compiles, but whenever I run Check50, I get a segmentation fault error for each category. Would definitely appreciate any help identifying where the problem can be fixed! #include <stdio.h&...
  • 7
0 votes
1 answer
4k views

invalid operands to binary expression ('double *' and 'double')

I am getting error with greater than operand '>'. I am sure that q1[n] hold value that is not integer. I am not sure how to do this when the q1[n] > 0.5 then c=1. Note that q1[n] is pointer to the ...
  • 1
0 votes
1 answer
9 views

for ( flush = status = eventOff = stopped = i = 0, span = increment, PlotLaunch = start = CarryOn = 1; CarryOn; i++, eventOff = 0, span += increment )

Can anyone clarify me about what is happening in this for loop declaration. for ( flush = status = eventOff = stopped = i = 0, span = increment, PlotLaunch = start = CarryOn = 1; ...
  • 1
0 votes
0 answers
24 views

Doing Stack Program using arrays in C++

I'm just trying to make a stack program, i think there is error in menu ( ) function or what could be the method to print menu again and again by not going with recursion. The code runs smooth on the ...
0 votes
1 answer
375 views

Makefile config

As we know.. in the appliance when we use the command.. . make [file-name] .. It automatically complied with some flag....-ggdb -O0 -std=c99 -Wall - Werror But I need to know in which directory the ...
  • 11