Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

create string with mix of variable and text and search array for it

$
0
0
My program randomly generates a number and keeps track of that number, because it loops and keeps adding those numbers I am basically generating molecules and I need to combine those molecules to search and array of existing amino acids... I have created the array one column has the written on combination of molecules

char names[18][3][20]= {
                        { "Alanine", "C3H7NO2", "89.0929" },
                        { "Aspartic acid", "C4H7NO4", "133.1024" },
                        { "Glutamic acid", "C5H9NO4", "147.1289" },
                        { "Phenylalanine", "C9H11NO2", "165.1887" },
                        { "Glycine", "C2H5NO2", "75.0664" },
                        { "Histidine", "C6H9N3O2", "155.1542" },
                        { "Isoleucine", "C6H13NO2", "131.1724" },
                        { "Lysine", "C6H14N2O2", "146.1870" },
                        { "Leucine", "C6H13NO2", "131.1724" },
                        { "Asparagine", "C4H8N2O3", "132.1176" },
                        { "Proline", "C5H9NO2", "115.1301" },
                        { "Glutamine", "C5H10N2O3", "146.1441" },
                        { "Arginine", "C6H14N4O2", "174.2004" },
                        { "Serine", "C3H7NO3", "105.0923" },
                        { "Threonine", "C4H9NO3", "119.1188" },
                        { "Valine", "C5H11NO2", "117.1459" },
                        { "Tryptophan", "C11H12N2O2", "204.2247" },
                        { "Tyrosine", "C9H11NO3", "181.1881" }
                        };




I don't know how to save the combination of numbers with text to match what I am searching for I have tried
 char *molecule = "C";C;"H";H;"N";N;"O";O; 

Viewing all articles
Browse latest Browse all 51036

Trending Articles