for ex. lets say I have the code:
printf("\nEnter a number");
scanf("%d*c*");
I want it to keep asking that over and over until someone presses a specific character to...
Type: Posts; User: cprogrammer1980
for ex. lets say I have the code:
printf("\nEnter a number");
scanf("%d*c*");
I want it to keep asking that over and over until someone presses a specific character to...
I understand what you mean but I am also passing in a 2nd array and a variable in the same function
I got it to display the first 4 by changing it to array[i]
for (i = 1;i<c;i++)
...
Thanks Jim
I tried the code you listed but it lists then 5 times like this
Banana Apple Grapes Lemon Tomato
I am trying to get it to say
Banana
Apple
lets say I have an array up here
char array[5][80] = {"banana","apple","grapes",
"lemon", "tomato"};
its a globally declared array
and in a function...
See the code you used I was doing that exact line because I know when the string is input by the user
for ex.
H e l l o
H is in the 0 place since it reads it in as an array of chars h is...
I'm lost...sorry
I'm thinking either I would have to state following all spaces after ignoring the first string, or add a second toupper function that only affects the very first string. . Right?
I used yours taters and it works whether I put it right after where I ask for input or right before I re-display the input , it capitalizes all of the letters except for the very first one and so if...
this is where I called it
strCase(description);
printf("\nThe description is %s", description);
it does capitalize all of them except the very first letter.
Aha I understand now, it only cares about the value being passed in and not what the name is or whatever variable name I give.
Now I tried the code, it works great but it does not capitalize the...
I see, I have one function that takes in the input from the user a second function that re-displays the user input so my guess would be to call it in that second function so it re-displays the input...
I see, It doesn't say anything about more than one space so that is fine but
question as to why you made strcase void?
Does it automatically do the conversions despite not being called anywhere...
now in the code below would this work for initializing i. I did it after declaring it
int strCase(char s[])
{
int i;
...
should I do this using an 'if' statement?
int strCase(char s[])
{
int i;
while (s[i] != '\0')
{
...
where would I initialize 'i' in my code??
When I take in the input or when I re-display it?
I got it to work but it still isn't capitalizing all my letters not sure why :\
void strCase(char s[])
{
int i;
while (s[i] != NULL)
{
s[i] = toupper(s[i]);
...
fixed thx
well here is what I have so far
void strCase(char s[])
{
int i;
while (s[i] != NULL)
{
...
I am trying to take a users input and then use a loop to loop through each individual character in the string the user has inputted. Then while it loops through it capitalizes the first letter only...
Hi all!
I am very closed to finished with this particular program but I want to be able to display my showCost() function before terminating the entire program when the user is prompted ...
sorry im not following....
I read that email but are you talking specifically about when I ask for a character input to validate the loop? 'Y' 'N' ??
Sorry I am a noob :s
Hi everyone, almost done with my code here but for some reason when the user enters 'Y' it does not loop up back to the top of the code. This is very important for me because I need it to display the...
I have gotten all my code to compile and work but there is one little thing I cannot get to work.
The total() function should be able to return cost * qty and price * qty but I am confused how...
Thank you so much
This is the code I have now:
{
double n;
printf("\nEnter the %s from %3.2lf to %3.2f:\a", item, min,...
Thanks Jim,
So should I change it from an int to a double instead? I see what you mean by the %d part that really confused me.