I have a function that is supposed to add a node to a linked list. I'm not sure what the other 2 parts of the for loop are for this. Can anyone help me figure those out? Also, is everything else I...
Type: Posts; User: laurenlb
I have a function that is supposed to add a node to a linked list. I'm not sure what the other 2 parts of the for loop are for this. Can anyone help me figure those out? Also, is everything else I...
And how would you replace it with '\0'?
This is what I have and it seems right. I just don't know how to replace the y with '\0'.
if (strcmp(&string1[stringlength-1], "y")==0)
{...
I'm learning strings and I have to write a program that (along with other things) takes a singular form of a noun and makes it plural. More specifically, the one I'm working with now is if the noun...
Thanks. I understand now.
Im just starting to learn about strings. Right now I'm just trying to prompt the user to input multiple words and then use the scanf function. Since I am just learning strings there may be other...
I don't know much about recursive functions at all, but so far i have this. Is this anything close to what i should have?
int sum(int x, int y)
{
if (number=0)
{
return 0;
I have this program that calculates the sum of the digits in a number but I have to make it recursive and i have no idea how a recursive function would even work for this kind of problem.
Where...
Thank you! that makes sense now. I was just assuming the that the first thing being printed was the result of the first inner loop. I didn't think it through that the first line was just completely...
I have this segment of a program that is supposed to print:
0
01
012
0123
01234
012345
and it does that, but I don't understand why. The first time through the inner for loop b isnt less...
I'm still having a lot of trouble breaking the number down into its digits. Can you help me out a little more with that part?
Is there another way to do it? We haven't learned strings yet so we are not supposed to incorporate them into this program.
i need to write a program where part of it is to see if the product of the digits in an inputed integer are odd or even. It has to return a 1 if odd and a 0 if it's even.
i.e. if 73 is inputed,...
Thanks to both of you. I finally figured it out.
I'm still not really getting anywhere. Can you explain any differently/more specific how the 2 for loops would like?
I'm pretty new to programming and I have an assignment for class that I'm having trouble figuring out how to start.
I have to use nested loops that will cause this to be displayed:
0
0 1
0 1...