Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

beginnner in C

Posted on 2003-03-06
6
Medium Priority
?
169 Views
Last Modified: 2010-04-15
Can anybody help me create a creative & cool login and password into a welcome menu screen that i never seen before.(programming in C)( C.cpp)

I am an beginnner in C
and i need an expert to help me as soon as possible.
0
Comment
Question by:micheal33
5 Comments
 

Author Comment

by:micheal33
ID: 8081174
I need as soon as possible
0
 

Author Comment

by:micheal33
ID: 8081198
Need help
0
 
LVL 6

Accepted Solution

by:
gj62 earned 160 total points
ID: 8081389
Define "cool"?  What platform are you on?  Is this in a GUI, or a console?

Assuming a console, the *basics* would be the following code, which I brazenly copied from a posting of Exceter's a few days ago...

This prompts a user (at the console) to enter a password, the password is hidden by *'s, and it allows backspaces.  Once you have the entered password, you can compare to an existing password by using:

if (strcmp(s,password)==0)
  printf("Password is correct");

#include <stdio.h>
#include <conio.h>
#define STRLEN 25

void input( char*, int );

int main()
{
   char s[STRLEN];
   printf("Enter password: ");
   input(s,STRLEN);
      printf("\n\n%s\n",s);
   return 0;
}

void input( char* buffer, int length )
{
 int pos = 0;
 char c;

 buffer[0] = '\0';

 while( ( c = getch() ) != 13 )
 {
     if( c != 8 && pos < ( length - 1 ) )
     {
         printf("*");
         buffer[pos] = c;
         pos++;
     }
     else if( pos != 0 && c == 8 )
     {
         printf("%c %c",8,8);
         pos--;
     }
 }
  buffer[pos] = '\0';
}
0
 
LVL 8

Assisted Solution

by:akshayxx
akshayxx earned 160 total points
ID: 8085249
programming in C . but what platform you are ON.. linux/windows ?
anything else .. any specific GUI library that u are already using ..
and as gj62 mentioned .. DEFINE "COOL"
for me anything that works is cool .. be it console based OR gui based..
its just that client prefer GUI stuff, which i hate coding .. to read a string u need to do so much of work .. :D

but most gui libraries reduce that work significantly..

so if u r looking for flashy GUI based stuff .. first choose some GUI library .. for linux i wud suggest .. GTK OR libQT.
for windows .. MFC has it all.. and if u want free stuff..
WxWindows.. ( thhis one is cross-platform )


0
 
LVL 20

Expert Comment

by:jmcg
ID: 10089344
Nothing has happened on this question in more than 10 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points between gj62 and akshayxx.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question