rename all files in a folder

Hello everybody! I need help I want to rename all files in a folder (exactly I want to change extansion file example:"FILE0001.CHK" to (FILE0001.JPG)), i know rename function , but how to use it all files, files names going sequencely(FILE0001.CHK,FILE002.CHK until FILE3000.CHK) guys how i can rename or change extansion file quickly and easily.
Thank you in advance!
$ ./a.out FILE*.CHK
1
2
3
4
int main(int argc, int argv){
   for(int K=1; K<argc; ++K)
      extension_change(argv[K], "jpg");
}



uppercase... puaj
Topic archived. No new replies allowed.