Thread: Codeblocks lets out a beep sound

  1. #1
    Registered User
    Join Date
    May 2017
    Posts
    31

    Codeblocks lets out a beep sound

    so my code is just few lines that im experimenting on,

    it runs and terminates abruptly under certain condition, when i press shift+f7 in codeblocks to fire up the debugger it does nothing, instead a small beep sound is what i hear.

    heres the code
    Code:
    #include <stdio.h>
    
    #define MAXLEN 100
    
    
    int getline(char s[], int lim);
    
    int main(){
    char line[MAXLEN];
    
    int len = 0;
    
    len = getline(line, MAXLEN);
    
    if(len > 0)
        printf("%s", line);
    
        return 0;
    }
    
    int getline(char s[], int lim){
        int i, c;
        for (i=0; i<lim-1 && (c=getchar()) != EOF && c!='\n'; ++i){
            s[i] = c;
        }
        if(c == '\n'){
            s[i] = c;
            ++i;
        }
    
        s[i] = '\0';
        return i;
    }

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Do you have gdb installed?
    Is it where C::B expects to find it?
    Codeblocks lets out a beep sound-screenshot-cb-gdb-png
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beep sound
    By Siaw Ys in forum C Programming
    Replies: 1
    Last Post: 12-23-2011, 10:10 AM
  2. alert beep sound
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 02-14-2006, 02:24 PM
  3. Producing Beep Sound with C++
    By ron4ldk in forum C++ Programming
    Replies: 8
    Last Post: 05-01-2004, 01:05 AM
  4. Sound *beep* usually
    By beely in forum Tech Board
    Replies: 11
    Last Post: 03-23-2003, 05:54 AM

Tags for this Thread