M.BM has number of items in inventory, and Q.front->BM has number of items user wants. After run this function M.BM should subtract number of items that user wants.
but, after run this function my...
Type: Posts; User: jk81
M.BM has number of items in inventory, and Q.front->BM has number of items user wants. After run this function M.BM should subtract number of items that user wants.
but, after run this function my...
now it takes ch but... skips scanf("%c", &name) before ch=getchar()
I tried to use gets, fgets instead of scanf, but same result.
Output:
Enter Firstname: <- skips Scanf and goes to getchar()...
scanf("\n%c", &variable> worked for other function..
but this function skips scanf again~!!!
when I used fflush(stdin), it worked on visual C++, but didn't work with other compilers.
I also tried...
the character value stores a name of user and the j stores his/her age.
those two things stored in queue.
I need to pop first data in queue and display them to the screen.
but I can not figure out...
this function suppose to get input from user and go to correct case and calculate number of items. but It skips user input and keeps says invalid input.
This is my output looks like:
1. Big Mac,...
this delete function suppose delete a character stored in linked list. but it gives me error on buffer=buffer->cursor->next; code.
void DeleteCharacter(bufferT buffer)
{
position ptemp;
this function suppose to move cusor to one space backward, but it gives me error. it compiles, but would not run...
definitions
typedef struct node{
char chdata;
struct node *link;
...
the input2 is global variable, it suppose to take rest of characters in array. Since input[0] has first character to tell what to do, I want to copy characters other than input[0] to input2.
the function decode input suppose to copy first letter of array to character c and then copy rest of array to character array input2.
but it copies first letter to c, but it does not copy rest of...
hmm....
maybe decoding causes the error??
but the O works fine though..
still don't get it why this program display "segmentation fault(core dumped) error"
/* Decode User Input */
void...
This function should get input c then call correct function.
but only thing works is displayoption with character O.
I though I might wrote function call wrong, but the Q(quit) is not working...
char userinput[100];
gets(userinput);
if gets(userinput) is wrong, then which function should I use?
scanf?
getch?
this function should find out the first element of array is an interger or a character, then store that element to character named C. but it does not do that..
What can be wrong?
this is my input...
is there C command that counts number of characters in a character array or string?
or do I have to create a function that counts number of characters in an array or a string?
this function supposed to open all empty spaces..
but it does not work properly..
void openemptyspace(int x, int y)
{
/* Declarations */
i reduced the code above..
sorry about that..
i narrowed down to those two functions..
I found another problem: calculating portion does not work..
can't figure out what's wrong with this program...
it's minesweeper program..
input of (0, 0) is automatic win...
if I uncover some area that doesn't have mines, it opens all area.
can't figure...
how can I make a function to calculate number of mines near by?
I wrote as this.. but it does not work properly.
int calculate()
{
int sum = 0;
int i;
int j;
i used stopper like this
if(addressbook[i].name == 0)
break;
but it does not work..
here's rest of my list function.
it still prints entries to screen, even though it's entry is empty.
how can I make it to stop, when there's no entry?
how can i make this function to stop after displaying 5 entries then resume displaying next 5 entries?
void listphonebook() /* List data */
{
int i=0;
char ch;
for(i=0;i<=...
/* Structure */
struct entry
{
char name[30];
char phoneNo[12];
char email[20];
};
/* Global declaration*/
struct entry addressbook[100];
this delete function suppose replace current array to last array.
but it gives me error message that
"incompatible type in my assignment"
is there some way to replace string?
i tried strcpy.....
thanks it works now..
now getinput works fine..
but search() doesn't work..
if values: n = jk
addressbook[1].name = jk
then it should return index number..
but if statement, and go to return -1.
What can it be...