+ 1

how can i count the number of file size for each user?

how can i count the number of file size for each user username: DCB files: 0,0,50,35,79 so user DCB has only 3 files (files with 0 dont count)

20th Dec 2016, 4:48 PM
Da Worm
Da Worm - avatar
6 Respuestas
+ 2
please explain your situation , I didn't understand
20th Dec 2016, 4:51 PM
Mohamed El Omari
Mohamed El Omari - avatar
+ 2
int numofFiles = 0; int files[5]; for(x = 0, x < 5, x++) { if (files[x] != 0) { numofFiles++; } } cout << numofFiles; Try this :)
20th Dec 2016, 4:59 PM
Syvered
Syvered - avatar
+ 2
well #Syvered gave you what you're looking for ;)
20th Dec 2016, 5:05 PM
Mohamed El Omari
Mohamed El Omari - avatar
+ 2
Let me know if it works
20th Dec 2016, 5:05 PM
Syvered
Syvered - avatar
+ 1
i have an array with usernames and file sizes as listed above and i need to list each username with how many files he has. username:ABC files:467,334,500,169,724 (5 files)
20th Dec 2016, 5:02 PM
Da Worm
Da Worm - avatar
0
Thanks Syvered i think it works but i have an array in a header which is file_sizes[82][5]
20th Dec 2016, 5:17 PM
Da Worm
Da Worm - avatar