Oups.. Thanks!
Type: Posts; User: Sotiris Kaniras
Oups.. Thanks!
Am I somewhere wrong?
#include <stdio.h>
#include <string.h>
struct contacts
{
Thankfully, the exercise got an overtime!
What do you mean: "you need to at least classify the issue (problem) into the correct category."?
Firstly, I'm sorry about the title, but it really was an SOS! (i had to send it by 5:00)
Secondly, the code wasn't mine.. I had just to add & change some things..
And thirdly, I wrote the code in...
SOS: What is this?
Screenshot by Lightshot
How do I do that?
#include <stdio.h>
int func(int a)
{
if (a == 5)
return (a = 2);
else
return a;
}
Nothing happened.. then I printed out "a" and it printed what I gave to it.. When I gave to the input 5, shouldn't it print 2?
Ok.. But can we use "return", in order to store data to a variable? For example, something like:
int func(int a)
{
if (a == 5)
return (a = 2);
else
return a;
So, we use it for typical reasons?
Ok, but return is not visible like printf() or usable, right?
Hello everyone.. I know it's a very stupid question, but I can't understand what exactly is the purpose of "return"?
What's exactly the lldb problem?
Why this program doesn't convert the character to number?
http://prntscr.com/vo2v4
Because the user, among other commands, he has to write play E4 not just E...
I realised that the problem is caused because of the "space" character.. Why?
Or you could just ask me nicely, instead of being ironic..
anyway.. ignore the command line arguments.. the input must be for example "play E4"... So, the program has to save the 4 to variable y and...
Well? :D
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "hfiles.h"
int main(int argc, char *argv[])
{
int k, j, x = -1, size, player;
Hi again.. I have this code:
for (k = 0; k < 4; k++)
if ((comp4 = strcmp(&command[k], "play")) == 0) {
comp5 = 2;
}
if (comp5 == 2) {
for (k = 0; k <...
Thanks man! :biggrin:
I suppose you didn't understand what I want to do..
I want to get a letter from the keyboard and convert it into its equal number.. A to 1, B to 2 ... Z to 26..
(Without using getchar() )
So? :D
Ok, but is possible to compare the char type variable with the enum at once? I mean, can I treat the enumerator as an array?
For example:
enum converter {A = 65, B, C, D, E, F, G, H, I, J, K,...
What I want to do, is to get a char type variable from the keyboard and compare it with the enum? Is that possible?