16,022,669 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by zahraZa (Top 5 by date)
zahraZa
29-Jan-12 3:38am
View
i want to write 8-puzzle code in prolog. for storing number from 1 to 8 i need an array. I think i should use array, is it true?
zahraZa
29-Jan-12 3:29am
View
i have read all of them , but i want to access easy to array elements ( but in List this is difficult).
zahraZa
23-Jun-11 13:41pm
View
thanks a lot,
but i don't want to use .read because user must can read records that saved in file(address of records in the file are random).File saveF must be readable.if i use txt file i should write field by field of my class(true?)if this is true can i access to record by random address ?
i don't know what should to do!!!!! :(
thanks for your help
zahraZa
23-Jun-11 6:58am
View
this is my code:
<prev>
void myclass::Get(){
ofstream saveF("c:/ms/SAVE.txt",ios::binary);
if(!saveF){
cout<<"\n\t\t\t ! Sorry can't open !\n";
exit(1);
}
else{
static string charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
myclass myRecord;
string result;
myclass *tmyclass=new myclass();
int myArray[10]={0};
srand(time(NULL));
node=new myclass();
for(int i=0;i<10000;i++){
myRecord.code=rand()%999+10000;
myRecord.Dgenerate = rand()%(21)+1350;
myRecord.Dexpire= = rand()%(21)+1370;
for(int m=0;m<9;m++){
myRecord.name[m]=charset[rand()%charset.length()];
}
myRecord.purity==rand()%(98)+1;
long int sCode=(myRecord.code)*(myRecord.code);int address=0,F=1;
for(int j=9;j>-1;j--){
myArray[j]=sCode%10;
sCode=sCode/10;
if((j>3) &&(j<7)){
address+=F*myArray[j];
F*=10;
}
}
address*=0.7;
saveF.write((char *)&myRecord,address *( sizeof(myRecord)));
if(i==0)
first=node;
}
}
}
void main(){
myclass d;
d.Get();
}
</prev>
zahraZa
19-Aug-10 16:24pm
View
Reason for my vote of 3
useful