Thread: Help please!!!

  1. #1
    Registered User
    Join Date
    Nov 2016
    Posts
    1

    Question Help please!!!

    insert
    Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    
    
    int copii(int a)
    {
        int c;
        c=a%10;
        return c;
    }
    It tells me c was not declared in this scope.. Wut???

  2. #2
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    If this is the whole program, you're definitely gonna want to have a main as well.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,161
    How To Ask Questions The Smart Way

    Your program fragment compiles just fine.

    You need to copy/paste your code from your editor, and copy/paste the exact error message(s) you get from the compiler.

    Random snippets and "wut" doesn't cut it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Dec 2016
    Posts
    1
    you can try putting a space between characters here - c=a%10 - and for 'c' to return something, should an 'a' have some value?? also check out these sites C Operators: Arithmetic, Logical, Conditional and more, C++ Language - C++ Tutorials, probably over there you can find some answers,
    best
    Last edited by Salem; 12-06-2016 at 01:50 AM. Reason: removed the homework cheat site.

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    4,508
    Quote Originally Posted by steph00 View Post
    ...
    Please don't link to cheat sites. Here we try to encourage people to do their own work, so they gain the necessary skills and abilities.

Popular pages Recent additions subscribe to a feed

Tags for this Thread