vnebojsa

Member
  • Content count

    333
  • Joined

  • Last visited

Community Reputation

100 Neutral

About vnebojsa

  • Rank
    Banned
  1. Real Command

    Please visit our Forum, register there and post if you have any questions or suggestions. Thanks for your time, Nebo Veron Real Command
  2. Loading text file and display it on the screen

    here's the code I have written few months ago: #include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> #include <windows.h> void handler(); void handler2(); void menu(); void directory(char *dir); //must be added to tell the compiler we will be //defining a function called directory() after it may called void main(){ menu(); } void menu(){ printf("ADDRESS BOOK\n\n"); printf("1. New\n"); printf("2. Open\n"); printf("3. Exit\n"); printf("\nChoice: "); handler(); } void handler(){ char ime[512]; char prezime[512]; char tel[512]; char fname[512]; char inputstr[128]; int chc1 = 0; scanf("%s",&inputstr); int len = strlen(inputstr); for(int i = 0; i < len; i++){ if((inputstr[i] < '0') || (inputstr[i] > '9')){ printf("\nWrong answer!"); Sleep(1500); system("CLS"); menu(); return; } } sscanf(inputstr,"%d",&chc1); if(chc1 == 1){ system("CLS"); printf("NEW:\n"); printf("\nFirst Name: "); scanf("%s",&ime); printf("Last Name: "); scanf("%s",&prezime); printf("Phone: "); if(scanf("%128s",&tel)){ printf("\nFilename: "); scanf("%128s",&fname); strcat(fname, ".adr"); if(fname){ FILE *out = fopen(fname,"wb+"); if(!out){ getch(); exit(0); } fprintf(out,"First Name: %s",ime); fprintf(out,"\r\nLast Name: %s",prezime); fprintf(out,"\r\nPhone: %s",tel); fclose(out); printf("\nSaved as \"%s\" !",fname); Sleep(2000); system("CLS"); } }else{ printf("Could not recieve input\n"); } menu(); return; }else if (chc1 == 2){ directory("./"); }else if (chc1 == 3){ printf("\nPress any key to exit..."); getch(); exit(0); }else{ printf("\nWrong answer!"); Sleep(1500); system("CLS"); menu(); return; } getch(); exit(0); } void handler2(){ int chc2; char inputstr[128]; printf("\n1. Back to Main Menu"); printf("\n2. Exit\n"); printf("\nChoice: "); scanf("%s", &inputstr); int len = strlen(inputstr); for(int i = 0; i < len; i++){ if((inputstr[i] < '0') || (inputstr[i] > '9')){ printf("\nWrong answer!"); Sleep(1500); system("CLS"); menu(); return; } } sscanf(inputstr,"%d",&chc2); if(chc2 == 1){ system("CLS"); menu(); return; }else if(chc2 == 2){ printf("\nPress any key to exit..."); getch(); exit(0); }else{ printf("\nWrong answer!\n\n"); Sleep(1500); system("CLS"); handler2(); return; } } void directory(char *dir){ char ffname[512]; FILE *in; char buf[100]; WIN32_FIND_DATA fd; HANDLE find = FindFirstFile( "*.adr", &fd); if(find != INVALID_HANDLE_VALUE){ system("CLS"); printf("Existing files:\n\n"); do{ if(fd.dwFileAttributes & ~FILE_ATTRIBUTE_DIRECTORY) puts(fd.cFileName); }while( FindNextFile(find, &fd)); FindClose(find); }else{ system("CLS"); printf("No existing files"); Sleep(2000); system("CLS"); menu(); } printf("\n\nFilename: "); scanf("%128s",&ffname); system("CLS"); strupr(ffname); strcat(ffname, ".adr"); printf("%s\n\n",ffname); if(!strstr(strlwr((char *)ffname),".adr")) strcat(ffname, ".adr"); if (in = fopen(ffname,"r")){ while(!feof(in)){ fgets(buf,sizeof(buf),in); printf("%s",buf); } printf("\n\n"); fclose(in); handler2(); }else{ printf("Error: File \"%s\" not found!", ffname); Sleep(3000); system("CLS"); menu(); return; } }
  3. Real Command

    Hello! ReCo Team proudly presents our official website which is still under construction and correctly show only with IE. We will fix those minor bugs, of course! Please check it out! Nebo Real Command
  4. Melody

    Ok, thanks! Can you explain me in several steps, how to make the normal mapping using Melody please? Nebo
  5. Melody

    Thank you! But can you tell me which of those is free or do you know any good but free programs? Nebo
  6. Melody

    Thanks! Do you guys know any other program for applying normal mapping? Nebo
  7. Melody

    Hello guys, I have just downloaded "Melody". It is an program used for generating normal mapping and other stuff. If i understood correctly, normal mapping is used to save the polycount, I mean, to have low poly model but with high poly look. I think I am right. But the problem is, I don't know how to use Melody. If you used it and you know how to use it, please write here in few steps, how to make normal mapping. Thanks, Nebo
  8. Please test my program

    thank you again. please test my program and comment it guys! Nebo
  9. Please test my program

    when you are saving and loading a file you have just to type filename without extension, it saves it automaticaly as .adr file. I know for that second bug, but i will fix it... thanks! Nebo
  10. Please test my program

    Hi! I proudly represent my program. Please test it and comment it with suggestions and critics. You can download it on: http://nebo.50megs.com/ Then go to programs and download adresar.rar Nebo
  11. C question

    Thank you Jonus, but I started with C++, then realized I should learn C first, so I use C then until I learn C++. :D
  12. C question

    Thank you very much!
  13. C question

    Yeah works good. There is just one bug, if there are no any files with adr extension i got some strange things on my screen, how to set it to print "There are no exisiting files" if there are no files?
  14. C question

    I get following errors: error C2065: 'fd' : undeclared identifier error C2228: left of '.dwFileAttributes' must have class/struct/union type error C2228: left of '.cFileName' must have class/struct/union type What to do?
  15. clearing the screen

    one more question. how to print an enum type on the screen? I tried this but it doesn't work: Code: ... enum stats {HEALTH = 100, MANA = 100}; stats health = HEALTH; printf(health); ... I get this error: error C2664: 'printf' : cannot convert parameter 1 from 'enum game_war::stats' to 'const char *' How to solve it?