Hello!
I have a struct named profile, inside the profile I have all kind of info, example:
typedef struct info
{
char *phone;
char *name;
.....
}info;
Type: Posts; User: Aviel Krantz
Hello!
I have a struct named profile, inside the profile I have all kind of info, example:
typedef struct info
{
char *phone;
char *name;
.....
}info;
It popped a message:
Ac access violation (segmentation fault) raised in your program.
[/QUOTE]
Did it
edit:
Ok I tried it, when I enter an invalid email like [email protected] it asks me to re-enter, but when I enter [email protected] it crashes...
But Users != NULL...
the thing is I tried to do something but it still crashes....
char* emailGet(char *email)//getting the email
{
users *current = Users;
point:
...
I meant something else, the thing with the loop is that, I start the program with a Users = NULL (a global struct) and I start building from him, so now I don't have anything in the Users->next field...
I edited my last message, I understand why it crashes, there is only one NODE at first, so it wont even go inside the loop, the only way to solve it is to add a condition in the start, but the...
The thing is, as I understand it, if I allocate 20 chars and only use 10, than the other 10 are gone, and that means if someone will later edit the email and will enter a 20 chars email it will leak....
"email" has been "malloced" outside the function before the function was called,
I changed the goto, I used it just because it makes it look less messy.
and I don't see any other way of the loop to...
Ok all of the errors are fixed, now time for some bugs...
So I have this function:
char* emailGet(char *email)//getting the email
{
users *current;
point:
current = Users
Ohh I just watched this realloc my bad it used to be a malloc..
Ok, I understand you!
now one more thing, what am I supposed to understand from this error?
Ok I got you both, but for example can I do this?:
char* emailGet(char *temp)//getting the email
{
printf("Enter email: ");
scanf("%s",temp);
while(emailCheck(temp) == 1)//if...
I do have the first function you've mentioned it just mallocs a char pointer, so your'e saying I should get rid of it?
Hey guys!
I was wondering, if I have a function like so:
char* function()
{
char *x;
......
......
......
return X