!SGkzNqBXEJutSYnahE:matrix.org

C Programming Language

684 Members
C Programming Ask C related questions here.62 Servers

Load older messages


SenderMessageTime
27 Apr 2020
@m2322ytismlg:matrix.org@m2322YTthat's broken as well 19:50:35
@dinu:matrix.orgdinuUgh it is autocomplete in most shells19:51:00
@m2322ytismlg:matrix.org@m2322YTif only you could remap your keyboard on the keyboard itself and not the os you're on19:52:15
@dinu:matrix.orgdinuBut passwd should change the password for the current user by default19:52:42
@m2322ytismlg:matrix.org@m2322YTrip I need a new keyboard 20:06:21
@m2322ytismlg:matrix.org@m2322YTsomeday 20:06:25
@m2322ytismlg:matrix.org@m2322YTwhen the b virus is gone I'll be able to get a new one20:06:54
@m2322ytismlg:matrix.org@m2322YTsupermarkets don't sell keyboards 20:07:16
@m2322ytismlg:matrix.org@m2322YTthey should 20:07:28
@natrius:matrix.orgStefan @m2322YT: Elextronic markets? Online? 20:11:12
@m2322ytismlg:matrix.org@m2322YTdon't have any online money only offline 20:11:53
@m2322ytismlg:matrix.org@m2322YTdon't even use a credit card20:12:05
@m2322ytismlg:matrix.org@m2322YTand I'm not old enough for amazon 20:12:28
@m2322ytismlg:matrix.org@m2322YTonly 1620:12:42
@natrius:matrix.orgStefan

I'm kind of stuck right now. How can i ouput 10 lines from a file and after a keypress the next 10 lines? Reading the file with

while(fgets(line, MAXSIZE, fp) != NULL) {
                    printf("%s", line);
                    i++;
    //                    printf("%5.d: ", i);
                }

Works, but how can i just print 10 lines. Maybe i should take a break but yeah. If i wrap this with some while(j<10){j++} it does not work. It prints every line but it does not count j++ for some reason i don't understand right now.

20:15:23
@natrius:matrix.orgStefanscratch that.20:16:42
@natrius:matrix.orgStefanIt counts but it does not affect the outer while loop. 20:16:56
@dinu:matrix.orgdinu
if (i % 10 == 0)
    getc();
20:17:26
@natrius:matrix.orgStefanmodulo?20:17:44
@dinu:matrix.orgdinuYes20:17:51
@dinu:matrix.orgdinu It should be getch() oops 20:19:07
@natrius:matrix.orgStefanoooooh20:19:03
@dinu:matrix.orgdinu *
if (i % 10 == 0)
    getch();
20:19:14
@natrius:matrix.orgStefanI always foget module. Should keep it in mind. 20:19:31
@m2322ytismlg:matrix.org@m2322YTthe nice about c is that it isn't strict about tabbing as python is20:22:33
@m2322ytismlg:matrix.org@m2322YT * the nice about c is that it isn't as strict about tabbing as python is20:22:48
@m2322ytismlg:matrix.org@m2322YT * the nice thing about c is that it isn't as strict about tabbing as python is20:23:16
@dinu:matrix.orgdinu There are plenty of programs you can write in one line in C (aside #includes) 20:23:19
@m2322ytismlg:matrix.org@m2322YTawesome 20:23:32
@dinu:matrix.orgdinuC doesn't really care about what kind of whitespace it is20:23:46

There are no newer messages yet.


Back to Room ListRoom Version: 4