Well, I have a project that needs to be able to play PCM buffer data.I have tried many ways to realize it,but in vain.Any ideas?
Type: Posts; User: Steve Cao
Well, I have a project that needs to be able to play PCM buffer data.I have tried many ways to realize it,but in vain.Any ideas?
ANS:
(1)In char a[10] , a is a constant.So you just can not assign "Hello" to it with "=".The second one "a" is a string pointer variable,so you can do it.
(2)Well the string pointer "a" points to...
The variable "nam" must be a string array when you call gets() to initialize it.BTW, the variable "no" hasn't been initialized.
How about this:
ssprintf(InvNoStr,"INVOICE NO:%s",InvNo);
Hi there,I AM STEVE.
Well I need to write a program to realize the inter-process communication with message quque, but when I finished it, the program when running seems to be blocked or just cann't...
But I did try it. It worked.
It will work out fine, if you just insert the space into sscanf():
sscanf("%d %15s %20s %f", &new->custId, new->Name, new->Surname, &new->accBalance);
the above error occurs in printf() funcitons.
shirtnumber is the type of integer, not a string.
"w+"means you can write and read the file.
"w" means the file can only be wirtten.So you need use "w+" to replace "w" in your first code.
There are two problems in your code. First, the file you created in the first code han't be initialized, which meaned the file was empty. You shall need to call fprintf() funtion to initialize it...
Yeah!It is working now.But I want to run it in VB, then I did try . However, it is a pity that it didn't work.Why?
Memloop is right!You should filter the '\n'.
Like this:
do{
............
}while(ch=='/n');
//it calculates the number of space/tab/enter key of the string you input from the keybord. But when I run it and input the string with "CTRL-Z" to end, nothing display on the dos screen. why??
...
How about this:(//the program find the armstrong number from 1 to 1000)
for(num=1;num<1001;num++)
{
temp_num=num;
sum=0;
sprintf(str,"%d",temp_num);
power=strlen(str);
Select the do..while loop will be ok!
int flag=0;
do
{
...........
if(a!=1&&a!=2&&a!=3)
flag=1;
//thanks Adak.
place=10;
while(number){
printf("%d\n",number%place);
number/=place;
}
Thanks!Adak.
It is nothing.
For what popurse you use the fseek(), you want to return the location or the number of characters?
fp must point to the undefined area.I suggest you use the whence "SEEK_SET" which is easy to control.
Take like these:
number=575;
printf("%d: %d\n",500,number/500);
number%=500;
printf("%d: %d\n",100,number/100);
number%=100;
printf("%d: %d\n",50,number/50);
number%=50;
printf("%d:...
Generally, segmentation fault error is the cause of like these:
the variable is out of control with forever addings.
the pointer points to the wrong memery area.
To get the length of "test.txt" file:
FILE *stdin_stream=fopen("test.txt","r");
// the file must exit and be initialized first in the current directory.
fseek(stdin_stream,0,SEEK_END);...