الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

[مخالف]تصحيح كود pointer ,, :)

مغلق
بدأه نسايم11 في 26 أبريل 2012 · 1 رد · 267 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ,,,

ارجوا منكم مساعدتي في حل هذا الكود ,,

Write a program that asks the user to enter his email account, the program then checks

the validity of the email as the following:

Check if the first digit is letter, if not ask the user to renter the email again.

Look for the symbol ‘@’ in the email, if not found ask the user to renter the email.

Then to verify the email ask the user to re-enter his email account, compare it with the first email, if

they are not identical ask user to renter email.

Your program should include:

Array of characters to store the email account

Pointer to move through the array elements

Two functions: validate and verify both functions receive pointer to array of chars;

validate return nothing and verify return a Boolean value to main.

لقد استطعت حل البرنامج ,, ولكن مشكلتي في pointer ,, رجعت ذاكرت الدرس ولكن لم استطع اكمال الحل ..

... واكيف اضعه بالطريقه المناسبه التي طلبها السؤال,,

حاولت قراءه اكثر من مرجع بالنت ولاافااائده :( ...

ارجوكم ساعدوني ,,, لدي العديد من الاسئله تشمل pointer ,,

اتمنى شرح طلبات السؤال الخاصه بـ pointer والاجابه عليه لكي استطيع الفهم ,,

ايضا يطلب السؤال التاكد من ان اول عنصر هو حرف ... هنا لم استطع وضع الشرط المناسب ,,, الرجال مساعدتي

جزاكم الللله كلللل خير :)

#include <iostream>
using namespace std;
void main()
{
char a[30]; 
char b[30]; 
int x=0;

cout<<"pleace enter your email"<<endl;
cin>>a;
//(a<65 || a>122)
while((a[0]<65)||(a[0]>90))||((a[0]<97)||(a[0]>122))
{   
	cout<<"pleace enter your email again"<<endl;
	cin>>a;
}
 for(int i=0;a!='\0';i++)
 {
	 if(a=='@')
		 x=1;
 }
 if(x!=1)
 { cout<<"pleace enter your email again you missing'@'"<<endl;
 cin>>a; }

 cout<<"pleace enter your email"<<endl;
 cin>>b;

 for(int j=0;a[j]!='\0';j++)
 {
	 while(a[j]!=b[j])
	 {
		 cout<<"pleace enter your email again"<<endl;
	     cin>>b; 
	 }
 }

}

تم تعديل هذه المشاركة بواسطة نسايم11 في 26 أبريل 2012 في 17:23

#2

الأخ الكريم/الأخت الكريمة

السلام عليكم ورحمة الله وبركاته

مرحباً بكم في منتدى الفريق العربي للبرمجة

تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات .

قواعد طرح المشاركات

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

{username}

مدونتي: C++ Tips and Tricks

هذا الموضوع مغلق.

مواضيع مشابهة