www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/01/01:30:21

From: Fozzy the Bear <fozzy99 AT geocities DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Simple password program
Date: Tue, 30 Jun 1998 22:29:42 -0700
Organization: InterNex Information Services 1-800-595-3333
Lines: 35
Message-ID: <3599C945.3AC1F40B@geocities.com>
NNTP-Posting-Host: sjas-30-0-18.sj.bigger.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello I am new to C but have learned alot so far, I tried to make a
simple password program, but it didn't turn out to be so simple.  I
can't get it to work.  I get this error:
    password.c: In function `main':
    password.c:22: invalid lvalue in assignment
please help me figure out what is wrong.

---------------------------start
here------------------------------------

#include <stdio.h>

main()
{
char name[30],password[50];   /* enough ?? */

    printf("login: ");
    scanf("%s",name);
    printf("password: ");
    scanf("%s",password);

    if(&name="fozzy")       /* ,&password==bear */
    {
        printf("Welcome %s\n");
    }
    else
    {
        print("You Do Not Have authorisation To Use This Computer!");
        print("This Attempt Will Be Logged When I Learn How");
    }

    /*  return 0;  */
}


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019