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;
}