User Profile
Collapse
-
ok i fixed it thanks. i changed the 'r' to '\n' and did some other small things... -
uh..by fine i didn't mean the word fine. I meant it displayed the input shape correctly. i do only have spaces and stars in my array. so you're saying the problem lies in how i take in the shape of stars and not the recursive fill function? the thing is that i am able to display the input correctly, so i think that the array is functioning properly when it goes into the fill function. the fill function seems to be what is screwing things up....Leave a comment:
-
that didn't really make a difference as anyway when the program display's the input shape, it displays it fine. i'm pretty sure the problem is in the fill function...Leave a comment:
-
basically now i get as the output a few lines of different lengths of asterisks and then after that a filled 20X20 box of asterisks....Leave a comment:
-
its still not working. do i have too many recusive calls? should i have something in my if statement of the fill function? i'm pretty sure the problem lies in the fill function itself. i really need help on this guys, i've really tried hard to do this myself....Leave a comment:
-
Need help filling a user-defined shape with asterisks using recursion in C
I'm trying to write a program in C that gets a shape outlined with asterisks from the user, and returns that shape filled with asterisks. It will also get the coordinates of a point inside the shape from which to start filling. I need to use recursion here. for example, to be clear:
input: (ignore the line, think of that as blank space)
*****
*___*
*****
coordinates are (2,1) /*its an array so numbering... -
its still works with 0 as a digit, but i was wondering, is this function still recursive if i use a while(n>0) statement? at the end of the while statement i put num=num/10;...Leave a comment:
-
ok i figured it out. i instead used a while statement. Thanks....Leave a comment:
-
i did that but now if i enter something like 456, my output is only 6...Leave a comment:
-
That was kind of the point because eventually i want the function to return whatever the value of sum is...so since thats not working what could i do to fix this problem?...Leave a comment:
-
Reversing digits of an integer using recursion
I am writing in C. I want to reverse the input integer using recursion so if the input is 456, the output should be 654. it only needs to work with positive numbers.
I've already written this function but the only output i get for any input is '0'. I know that its the same 0 from sum=0; because when i change 'sum' to any other number at the beginning, that number is outputted. its almost as if the 'if' clause is being skipped completely.... -
I don't use "to_Error" anywhere in the program. I've never heard of it. my program is a simple one that just tells you whether your input string is a palindrome or not. how can i just define something when i don't know what it is? My program is pretty straightforward and i haven't tried anything unusual to the other programs i write....Leave a comment:
-
What does this error message mean?: undefined reference to_Error
I'm trying to compile a program in C and i get this error i've never seen before. When i click on the error it just highlights the last brace of my program. the compiler i'm using is lcc-win32 -
Thanks i got it to work. to make things simpler, i also changed the EOF to '\n' so i can just hit the RETURN key to end the input...Leave a comment:
-
No, it doesn't run infinitely. rather, i input the string of letters and then i press ENTER and nothing happens. i thought i would use EOF so when i pressed ENTER i could stop the input. i have to use enumeration types because that is a requirement for this assignment.
what i want is the following: for example if i input 'acde' for set_A, i first want let=a so set_A[a]=TRUE, and then let=c so set_A[c]=TRUE and so on....Leave a comment:
-
No, it doesn't run infinitely. rather, i input the string of letters and then i press ENTER and nothing happens. i thought i would use EOF so when i pressed ENTER i could stop the input. i have to use enumeration types because that is a requirement for this assignment.
what i want is the following: for example if i input 'acde' for set_A, i first want let=a so set_A[a]=TRUE, and then let=c so set_A[c]=TRUE and so on.Leave a comment:
-
Function using enumerated values and arrays in C
I want this function (which is a part of a larger program) to read a bunch of letters (they will all be different letters) and assign the index of that letter in the array to carry the value TRUE. there are two arrays i want to do this do: set_A and set_B.
actually, i made an enumeration type earlier in the program which defines all lowercase letters as type letters. it was necessary that i use the enum type.
This is not working...
No activity results to display
Show More
Leave a comment: