I have attempted this with the following code
Expand|Select|Wrap|Line Numbers
- //Create as many txt files as there are valid propagation constants
- //Propagation constants are elements of the vector beta
- for(int j=0;j<(int)(number_of_nodes);j++){
- if(*(beta+j)>substrate*k && *(beta+i)<core*k){
- FILE *p_j;
- p_j=fopen("c:\\data_j.txt","w");
- }
- }
so that I can send data to each of these txt files later.
The code as it stands doesn't work. It just opens a single txt file called data_j.txt
Can anyojne tell me how to do it so it creates multiple files with different file names?