I'm not really a fan of c++ and don't know much about the advanced topics, but I'll try to help if I can. A virtual function is one that is...
The do-while loop sits and waits for a test condition to be true (or false depending on what you're wanting to do). For example, say you want a...
With numbers, you could try something like int x; do { // prompt for and store input if(std::cin.fail()) { std::cin.clear();...
I've been toying around with game ideas while trying to figure out threading; I've got a simple program and was hoping to get an idea on any...
I'm guessing it's the maximum number of points to consider in the data set. you've got 3 doubles for each index position from 0 up to...
If I had something like typedef struct { std::string some_data; } foo; foo init_data[] = { { "" }, { "" }, { "" } }; typedef...
your char comparison should be && and not || or maybe use toupper() or tolower() and test that way. if(tolower(ans1) != 'a') correct -=...
I agree with you that most books start off with a simple topic and then advance it to the point of confusion. It's very hard to learn on your...
if you mean something like like "does AGCT exist in this string?" then couldn't you just use strstr? int isLegitSequence(char *sequence, char...
for a list that is already sorted, reversing it *should* work, but you'd only want to walk through half of the items. maybe like void...
Here's a bit of sample code for adding, searching records in a binary file. If anyone sees anything problematic, please point it out. Thanks. :)...
in the function "get_question" you've got if(strcmp((fgets(read_all[i],300,question_lvl)),("-1"))==0) I don't know what your data...
Write a C program the print the calendar of certain month. This can be done by asking the user to enter the starting day of the month and the...
it depends; if *a points to an existing array of 10 elements, then yes. If not, then you'd need to dynamically allocate space for the 10...
Not really tested, but maybe it works... I'm too sleepy to argue with it any longer. :biggrin: #include <stdio.h> #include <string.h>...
A simple idea might be to use an array of strings and an integer as your private data. const std::string DOW[] = { "Sunday", "Monday", ... };...
y = myfunction(x); y = x > 0 ? 1 : x == 0 ? 0 : -1; you could write a function and pass x as a parameter, evaluate it inside of the function...
I'm not quite sure if you mean two pointers or just one to the array or the value of 9... is that the 9th element in the array? int arr[25] =...
Here's a bit of code to display distributation of grades in form of percentages and a crude line graph. If anyone sees a problem or perhaps has...
member function "sh" is prototyped as returning an int, but the definition is void. fix that and you *should* be okay. why not make your array...
Separate names with a comma.