Sha256: b8d201e185e7858ddcc10a7737c8b976226a43e2653a7f5335a07d56de429516
Contents?: true
Size: 547 Bytes
Versions: 131
Compression:
Stored size: 547 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 = malloc(sizeof(char) * len); 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
131 entries across 131 versions & 1 rubygems