I do agree with u ^_^
Type: Posts; User: rpbear
I do agree with u ^_^
The problem is that dup will use the minimum unused file descriptor as the newly open file descriptor.However,without using dup2,how can I make sure that my function will use the specified file...
Hi all,I'm reading <Advanced programming in the UNIX environment>,that book asked the reader to implement a function which has same functions with dup2 without calling fcntl.Could anyone give me a...
using stringstream will be easier:
string sep,string1,string2;
int int1;
float float1;
getline(file,str);
istringstream ss(str);
ss>>sep>>string1>>sep>>int1>>sep>>float1>>sep>>string2;
then do...
I understand.However,if I change the p's value,the value of the list will change,I don't know why
Hi all.I wrote a program to impelement the add operation of polynomial with list.For example,I wanna do the add operation on
x^2+3x^4+6x^5 AND x-5x^4+x^5-4x^6
I creat two list,the input should be:...
replace the code
re_w = re_w*W_RE - im_w*W_IM;
im_w = im_w*W_RE + re_w*W_IM;
with
save_re = re_w;save_im = im_w;
re_w = save_re*W_RE(len_x) - save_im*W_IM(len_x);
im_w =...
thanks,I do use the Cooley-Tukey algorithm.I modified my code as you said,and the answer's still wrong,did u find any logical mistake in my code?
any hint?
hi,all.I wrote this program to implement the FFT algorithm.Running with wrong answer.can anybody tell me what mistake i made?thanks!
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
...
agreed!
look at the end of the for,you add one ;
that's a mistake caused by careless~~
it means if
#define a(x) 1##x
and you ues printf to do this:
printf("%d",a(34));
it'll prodecu 134
this happened because you haven't init the array----message[fileSize]
add one line after that:
memset(message,0,fileSize);
second,you can't expect that the fread will read in char as much as...
try the code below
#include<stdio.h>
#include<stdlib.h>
int
main(){
FILE* fin = fopen("d:\\a.txt","r");
long ld = 0;
maybe this one helps you
s = "fsdf455";
while(*s){
if(isdigit(*s))
printf("%c",(*s));
++s;
}
the first one used as a initial expression of string,not just a pointer,which means it can't be use if not give it the space with malloc or somewhat else when you using it not as a initial...
#include<stdio.h>
#include<stdlib.h>
int
main(){
int i = 0x1;
int n = 0,input = 0,output = 0;
scanf("%d",&n);
input = n;