Sha256: b74f7252aadc58bb62dec9ea50943e2f0e4504735ba8dffec50f2ae7314d14a1
Contents?: true
Size: 550 Bytes
Versions: 265
Compression:
Stored size: 550 Bytes
Contents
#include <stdlib.h> #include <string.h> #include "rna_transcription.h" char *to_rna(const char *dna) { size_t len = strlen(dna); char *rna = calloc(sizeof(char), len + 1); for (size_t i = 0; i < len; i++) { switch (dna[i]) { case 'G': rna[i] = 'C'; break; case 'C': rna[i] = 'G'; break; case 'T': rna[i] = 'A'; break; case 'A': rna[i] = 'U'; break; default: free(rna); return NULL; } } return rna; }
Version data entries
265 entries across 265 versions & 1 rubygems