SHARE
TWEET

Untitled

a guest Apr 19th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. #define MAX_DM_COUNT 7
  5.  
  6. void read_into(char str_list[MAX_DM_COUNT][50], FILE *file) {
  7.     int i;
  8.     for (i = 0; !feof(file); ++i)
  9.     {
  10.         fgets(str_list[i], 100, file);
  11.     }
  12.  
  13. }
  14.  
  15. void show_dms(char list[MAX_DM_COUNT][50]) {
  16.     int i;
  17.     int len = sizeof(list) / sizeof(char[50]);
  18.     for (i = 0; i < len; ++i)
  19.         printf("Some DM");
  20. }
  21.  
  22. int main() {
  23.     FILE *file;
  24.     char dm_list[MAX_DM_COUNT][50];
  25.     printf("Here");
  26.     file = fopen("~/.config/dman/display-managers.txt", "r");
  27.     printf("Here");
  28.     read_into(dm_list, file);
  29.     show_dms(dm_list);
  30.     printf("Pick your poison:");
  31.     return 0;
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top