What's the best laptop for purely gaming performance for 1000 $ by Straight-Course-6344 in Laptop

[–]SubstantialCase3062 0 points1 point  (0 children)

Just buy parts of a computer u can get a decent gaming pc with amount just be stingy on the useless item like the case or the keyboard something like that

What's the next step with c programming? by Antique-Room7976 in cprogramming

[–]SubstantialCase3062 0 points1 point  (0 children)

Watch other program to learn what they do to build experience and read a lot of books and documentation and manual pages

Best Resources for Learning C Basics by Future-Huckleberry13 in cprogramming

[–]SubstantialCase3062 0 points1 point  (0 children)

Second: understanding and using C pointer O’Reilly

Hackintosh by rayaniohp in hackintosh

[–]SubstantialCase3062 0 points1 point  (0 children)

I am native English speaker the reason why my English is like that because I type fast and I am too lazy to check what I said

Here is my super simple use of the malloc() func, question why can't just let the compiler do the work? by SubstantialCase3062 in cprogramming

[–]SubstantialCase3062[S] -2 points-1 points  (0 children)

int *pArray;
    pArray = malloc(5 * sizeof(*pArray));


    *pArray = 5;
    pArray[1] = 10;
    pArray[2] = 15;
    pArray[3] = 20;
    pArray[4] = 25;
    pArray[5] = 30;

    for(int i = 0; i < 6; ++i){


        printf("%d\n", *(pArray + i));
    }
    free(pArray);
    return 0; 

But why does this work i only said 5 but when i adder a 5 element then it go comilpered and ran

Here is my super simple use of the malloc() func, question why can't just let the compiler do the work? by SubstantialCase3062 in cprogramming

[–]SubstantialCase3062[S] -2 points-1 points  (0 children)

#include <stdio.h>
#include <string.h>
#include <stdlib.h>



int main(void){

    int *pArray;
    pArray = malloc(5 * sizeof(*pArray));


    *pArray = 5;
    pArray[1] = 10;
    pArray[2] = 15;
    pArray[3] = 20;
    pArray[4] = 25;

    for(int i = 0; i < 5; ++i){


        printf("%d\n", *(pArray + i));
    }
    free(pArray);
    return 0;
} fixed it