so know this is what i get
with this code:
int availability(Grocery_Arr groc_list, InvArr inv_list, int num_grocItems, int num_invItems){
int compare,...
Type: Posts; User: trprince
so know this is what i get
with this code:
int availability(Grocery_Arr groc_list, InvArr inv_list, int num_grocItems, int num_invItems){
int compare,...
ok so now my functon is this
int availability(Grocery_Arr groc_list, InvArr inv_list, int num_items){
int count;
float total = 0.0, new_price;
for(count = 0; count < num_items;...
it doesn't even read them...i'm so out of ideas
ok...so when i do the
match = (strcmp(groc_list[count].name, inv_list[count].name) == 0);
i get this output
even when i change the name, I'm still gettting the same thing. I don't really understand.
what do you mean check the condition. If it does =0 then do the following statements. Should I chagne it?
So just make it a plain while loop?
It's multiplying by the first one then the second one and so on.
oksy so now I have two problems. The last sentinel (done 0) is printing and i don't want that because its my sentinel. And also the big problem is that my numbers new_price is multiplying wrong. I...
I am writing a function that compares two structures. It compares the names and the quantity. The total cost is then the price times the quantity wanted. if the the item is not there then there is a...
the alphabet code
i am using the ctype.h header file too
void encrypt(char secret[],char message[],char coded[]){
int count;
char letter;
for(count = 0;count < MAXLEN;count++){
letter...
so do i not need to use isalpha even though I don't want it to change the punctuation marks. I only want to change the letters to lower case and then encrypt them. the punctuation statys the same in...
could I do something like this too
void encrypt(char secret[],char message[],char coded[]){
int count;
char letter;
for(count = 0;count < MAXLEN;count++){
letter =...
ok...so now my program should do what i want? but i am also getting a compilation error/warning for this line
void encrypt(char secret[],char message[],char coded[]){
int count;
...
any thoughts
ok...so now my program should do what i want? but i am also getting a compilation error/warning for this line
void encrypt(char secret[],char message[],char coded[]){
int count;
char...
void encrypt(char secret[],char message[],char coded[]){
int count;
char letter;
for(count = 0;count < MAXLEN;count++){
letter = message[count];
...
ok now that you say that...then my encrypt function is wrong. I need to take each character to see if it is a letter, then change it to lower case, then encrypt by mapping using 'a' as index 0 and...
ok. can you look at my program. my program generates a random number 1-5, reads the input text of five lines and the original message, the key number generated corresponds to one of the five lines...
does this work
void encrypt(char secret[],char message[],char coded[]){
int count;
char letter;
for(count = 0;count < MAXLEN;count++){
letter = message[count];
...
OK That makes sense. thanks. now where does the third parameter come in. i take in three arrays. secret[] is the key, message[] is the original input that needs to be encrpted, and coded is the...
sorry , i'm a beginner, can you explain what that line means
if(isalpha(letter))
{
message[count] = coded['a' - letter];
}
is it saying that the 'a' minus letter position in the coded...
oh ok..thanks....that makes sense. what is the logic or how to I go about doing the encryption. i was thinking that i have to mapp the index with the key. but i'm not sure where to start. i know...
this is the main function
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <time.h>
#define MAXLEN 81
#define ALPHABETSIZE 26
oh ok. yes A maps to 0. so fgets gets an entire string if it'n not a character. do i use getchar()? what do i need to fix