No sound with \a in cygwin [closed] - c

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I'm doing some coding using cygwin with c programming. There is no sound with \a. Do I have to install some packages? There is no problem with cl compiler.
#include <stdio.h>
int main()
{
printf("\a");
return 0;
}
with the following setting
gcc test.c -o fun.exe

I am going to guess that it has something to do with the terminal emulator you are using. I am using mintty. When I edit the options, I am able to specify the behavior of "Bell".
When uncheck "Sound" I don't hear anything. When I check "Sound", I hear a beep.

Related

I Cannot run my code due to this error in vscode. I cannot understand the error [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed last year.
Improve this question
I Cannot run my code due to this error in vs code. I cannot understand the error. I have attached the image link below.
https://i.stack.imgur.com/7FVJm.png
The thing happening here due to WinMain error is The compiler is not getting any instruction from where to start executing the code (This happens when we don't have a main() function in the program) As Your program already has the int main() function but it is clearly seen that you have not saved your file before Compiling so,
You Should Save your file before running/compiling it byCtrl-S
also, You can change the settings of the Code runner to Save on Run so you won't have to save your code again and again
Save your file by pressing ctrl+S and then run it again.

C power function and scanf [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
So basically, I need to get an input and square it. some reason the pow() function isn't working.
#include <stdio.h>
#include <math.h>
int main (){
int in, ans;
scans("%d", &in);
ans = pow(in, 2);
printf("answer is: %d", ans);
return 0;
}
The error is :
undefined pow or something like that
This type of error occur when you forgot to link your programme to the math library .
use -lm for linking to math library.
gcc yourfilename.c -lm
to use the math library
I think you have compiled on Linux platform. So, use -lm option with command.
gcc yourfile.c -lm
You are using scans instead of scanf. It should scanf("%d",&in);

Trouble building regex to compile with regcomp [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I am trying to build a regular expression to satisfy strings like the following: ${AnyTextHere}. This is what I have right now: \\${[a-zA-Z0-9]+} It works in some online regular expression checkers, but not with regcomp.
You may also have to escape curly braces {, as they are considered regex special characters.
\\$\\{[a-zA-Z0-9]+\\}
^ ^
see regex demo

how do I solve build and run error in this code of C using CodeBlocks? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am new to programming world and started with C and i want to build and run this code but it says error or multiple main function, the code is:
#include <stdio.h>
int main()
{
int age;
printf("I got %d%% on my C exam\n",98);
return 0;
}
You probably created a default project with an existing C source file containing a main, then you probably added a new file to type your code that contains a main, and then the IDE complains when compiling because you have two mains. Remove the default file from the project.

php extension code must be c89 style [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I wrote a php extension: https://github.com/binpack/binpack-php, it works great and I want to submit this extension to PECL.
But they said that my code is C99 style and PHP except C89 style. I read somethings about C99 and C89.
And figure out some difference:
stdbool.h
inline vs __inline__
I think there are some problem in these 2 files:
https://github.com/binpack/binpack-php/blob/master/bin_pack.c
https://github.com/binpack/binpack-php/blob/master/bin_pack.h
I modified some of my code and used -std=gnu89 to test them. But I am not sure if there are still some problems.
My question is:
How can I test if my code is c89 style?
If anyone can point out the problems in my code, that will be great.
It won't warn about every feature not in C89, but
gcc -Wall -pedantic -std=c89 ...
is a good place to start.

Resources