Recent content by ZakAttk1

  1. Z

    Which Fibonacci number would you like me to compute

    I'm given a source file: int main() { bool running = true; string pre_sum; int fib_th; while (running) { cout << "Which Fibonacci number would you like me to compute ? ('q' to quit) "; cin >> pre_sum; fib_th = atoi(pre_sum.c_str()); if ( pre_sum[0] == 'q' ) {...
  2. Z

    C/C++ How to Calculate the Average of Numbers from a File Using C++?

    How do I use file streams to extract numbers from a file, add them up, and average them out?
  3. Z

    Pointers not allowed to used iostream

    So to mark the end of the string I'll have to do something with *word = '\0'. Is that relevant?
  4. Z

    Pointers not allowed to used iostream

    I want to infinitely print a saying to the console but I am not allowed to used iostream. I am using the function putc. I understand I need to use an infinite loop. So far I have: int main() { char *word; word = &SAYING[0]; while(true) { putc(*word, stdout); word ++...
  5. Z

    Finding Characters in Strings: timesFound() Function

    I have an assignment for my CS class. It is the following: * * complete the function: * * timesFound(string searchIn, char searchFor); * * The function should return the number of times the * character searchFor appears in the string searchIn. * */ int timesFound(string...
Back
Top