Thanks!
Type: Posts; User: georgio777
Thanks!
Thanks! Can you give me an example of how to use strtol().
That's a good suggestion, but I need to still maintain characters for the 'q' value.
What I'm trying to do is find a way that both characters and integers can be stored in a integer.
Hi all, for a CS project I need to make a menu, so the user must input values from 1 to 12 and q to exit the program.
My main problem is that I am using getchar() to scan the menu selection.
So...
Hahahahahahaha
Sorry
I promise it would NOT happen again!
Here is the working code:
#include <stdio.h>
#include <stdlib.h>
#include "arrayv.h"
/* This function will find the number of vowels in the word and output their position using a * to...
OK, I managed to make it work!!! Thank you for your time, I didn't know it was that easy. Sorry if I insisted to much. I accept I was a little immature. I promise it would happen again!
Again...
OK, I'm done with this, probably I'm going to talk directly with my teacher.
This is so confusing :confused:
Thank you anyway to everyone.
At least you gave me an idea!
Have a nice day...
At least give a hint. I don't really want to spent all day long trying to find the solution.
Another thing, I never heard of the definition flag or explicit flags, what does this means.
Well, that's what I am trying to do, but now I'm getting more and more lost :confused:
Yep, I understand reason why is not working and why is wrong, but how about the one you told me?
This one:
for(i=0; str[i] != '\0'; i++)
{
for(j=0; strv[j] != '\0'; j++)
{
Oh, now I understand!
But what about this?
Why this one is not working also?
for(i=0; str[i] != '\0'; i++)
{
The code should look like this:
for(i=0; str[i] != '\0'; i++)
{
for(j=0; strv[j] != '\0'; j++)
{
if (str[i] == strv[j])
{
Ok, let see:
for each letter in the source string ... ok, how do I do that?
#1 The source string is char str[100];
#2 Since is for each letter I need to create a for loop
#3 The int i; is the...
When you said another check, you mean a if statement?
And the space is when is NOT a vowel.
For instance as I gave a example before:
first
*
That's why I'm trying to do, but I'm unsure about the break statement, because as I can see when the compiler passes through the breaking point, it stops the complete for loop.
Not with the break statement.
Even though I need to fix that.
Ok, you're right, I agree with you, it's better not to give the answers, so let's try again.
And yes I know what break does.
int i, j;
for(i=0; str[i] != '\0'; i++)
{
for(j=0; strv[j]...
As my understand the code should look like this:
int i, j;
for(i=0; str[i] != '\0'; i++)
{
for(j=0; strv[j] != '\0'; j++)
{
Yes, and you are right, I'm not thinking in using any function or creating one.
I'm still trying to manage solving/writing the program with the two nested for loops.
Oh, ok. Probably I'm gonna stick with nadroj idea.
Oh, you're right, the teacher said something about isvowel, let see if I can do a little bit of more research related to that function!
Thanks!
I fell really dumb since I don't really understand what are you trying to say.
I know that I need to do is nested for loops but I don't understand why. I sort got an idea that each character of...
Oh, you are right, I'm comparing the same index of the input word with the one of the string index of the vowels.
My question is, in the for loops, both of them must include the if statement or...
Thanks, it's sort like what I did, in exception that I can't find the standard library function to find the character in the string. As my guess is:
strchr()