Code::Blocks Forums

User forums => Help => Topic started by: jlb on August 23, 2016, 09:07:22 pm

Title: Problems compiling
Post by: jlb on August 23, 2016, 09:07:22 pm
Hi guys. I'm starting to use Codeblocks and I have a little problem... When I run my projects ( in C) I have no errors nor warnings. The window with the compiled program comes up, I can type all the data, numbers or words the program needs, but once I press enter to get an answer, it gets stucked and does nothing. For examle, I make a program to multiply two numbers, when I run it I can type those two numbers but when I press enter to get the result nothing happens. I don't know what this could be. It'd be of much help if you could give me a hand. Thanx.
Title: Re: Problems compiling
Post by: stahta01 on August 23, 2016, 10:37:09 pm
I suggest you post your code on a site like http://cboard.cprogramming.com/forum.php (http://cboard.cprogramming.com/forum.php)

Because your problem sounds like a coding issues and NOT a Code::Blocks issue.

They will likely want a full re-build log see http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

If you think it is NOT a coding issue please post the full re-build log in this thread and maybe I or someone else will see an error.

Tim S.
Title: Re: Problems compiling
Post by: jlb on August 25, 2016, 09:45:22 pm
Code
#include <stdio.h>
#include <conio.h>

void div(int a, int b)
{
    int i,result=0,rest=0,p;
    for(i=1;i=a;i++)
        if((i*b)<a)
        result=i;
    else



        p=result*b;
        rest=a-p;

        printf("The quotient is %d and the reminder is %d",result,rest);

        return;
}


int main()
{
    int a,b;

    printf("Please type the dividend: \n");
    scanf("%d",&a);
    printf("Now, type the divisor. REMEMBER TO CHOOSE A SMALLER NUMBER: \n");
    scanf("%d",&b);

    div(a,b);

    return 0;

}
 


Here it is. To be honest I really thought the code was ok, because every time it was wrong the project didn run at all. Sorry to bother
Title: Re: Problems compiling
Post by: stahta01 on August 26, 2016, 12:40:37 am
Please post the requested full rebuild log; please reads the rules before you get banned!

Edit: Link to rules http://forums.codeblocks.org/index.php/topic,9996.0.html (http://forums.codeblocks.org/index.php/topic,9996.0.html)

Tim S.
Title: Re: Problems compiling
Post by: stahta01 on August 26, 2016, 01:02:13 am
Looks like bad code; we do NOT help people with bad code on this site.

Tim S.