Ok that makes sense.
But...
Does that mean that occasionally you can?
Type: Posts; User: Hexadakota
Ok that makes sense.
But...
Does that mean that occasionally you can?
This is my simple little function
int reverse_list(void) //creates a list of ints from 0 to N
{
int N = 20;
int temp_array[N];
for(int i = 0; i < N; i++)
oh....
....duh
I want to make a simple singly linked list. The conversion constructor in the class "slist" is slist(const char* c) and I want it to just take a string, reverse it, and prepend it so that each letter...
Ahh! You're all right about the strrev. I really was just assigning it a decrementing value that wasn't even related to the string. Duh...
EDIT: You guys were right about strcmp too. Such a...
My goal is to take a string and do various modifications with it like reversing it, printing it, printing it up to n places, and comparing it to another string using the class my_string.
This is...
This may sound stupid, but how exactly to I insert the null terminator into the second string? I'm drawing a blank. I know what it is and how it works, but I don't know the syntax for hard coding it...
I'm majoring in Computer Science at the University of Minnesota and I need a laptop. It would make everything easier, and I need to be able to program pretty much at any point in the day.
I don't...
Sweet, thanks for the advice. I'm making progress. This is what I have now.
The int main() function is the same...the reverse function has been changed to
void reverse(const char s1[], char...
My goal is to take a simple string like "My name is Don Knuth!", print it, then print it in reverse order. The rules are, I need to use this class
class ch_stack{
public:
...
I'm sure she'd love hearing that from me, the only kid in the class who doesn't know how to use arrays.
EDIT: Thanks for all the advice Elysia. Everything worked!
Oh I see. Every time I looped I was just printing the same pointer over and over again. I put an [i] after the data and it printed what was in the array. Duh! Thanks for the help.
Crap. One more...
No.
This is the second program I've ever written and the little I know about arrays I learned from googling it. I understand now that it's treating the values as addresses that hold values...how...
Ahhh I see. It's printing addresses instead of values. How do I make it print the values in the array?
The function needs to have size as default...it's part of the homework >_<...sorry I didn't mention that.
And it's consistently still printing the same junk...0x22ff50 for int, 0x22ff30 for float...
I have a very simple function using overloading function. It's just supposed to send an array to a function, and the function prints out that array "size" times. It's printing it out the correct...
...aside from using something like print screen?
I have this nice neat, simple program and I have a correct output, but I don't know how to print the text that comes up in the little black window...
Haha. Yeah I'm an idiot.
Thanks a lot guys. Everything worked.
Sweet. All the advice worked. The numbers are being properly converted.
but now...
int degree(char a) //Function to change degree sign which takes in a letter
{
...
Are you talking about...
return(n, a);
...
If so, how do I return both the double and the char back? Like if I inputed 212F, how I would get a 100C from the function returned to main?
So I'm an absolute beginner writing my first program. It's a simple one which converts Celsius to Fahrenheit and visa versa. I want the input to be something like 32F, 0C, 212F and a 456G to check...