Jump to content

duckwithanokhat

Member
  • Posts

    376
  • Joined

  • Last visited

Reputation Activity

  1. Informative
    duckwithanokhat reacted to JoostinOnline in Need help manipulating strings in C.   
    That's because you're just making str2 a pointer to the second character of str1.  You want to give it its own array.  Do you know how big the maximum length will be?  If you do, then the easiest way is to just copy it over.
    char str2[20]; strncpy(str2, str1 + 1 , sizeof(str2) - 1); Change 20 to whatever the maximum length is.  The use of strncpy instead of strcpy is to prevent any overflows.  You could also use
    char str2[20]; strncpy(str2, str1 + 1 , 20); However, in that situation you'd have to remember to change both 20's.  It's not a big deal in small code, but when you start writing massive programs, it lets you simultaneously change all the values.
  2. Like
    duckwithanokhat got a reaction from ThatNewbieDM in Is the 240 the best GPU for future proofing?   
    LOL
     
    >be me
    >buy nice red gpu
    >saw in half for crossfire
    >gain power
  3. Funny
    duckwithanokhat got a reaction from undeadfake in Is the 240 the best GPU for future proofing?   
    LOL
     
    >be me
    >buy nice red gpu
    >saw in half for crossfire
    >gain power
  4. Funny
    duckwithanokhat reacted to aisle9 in Is the 240 the best GPU for future proofing?   
    >Buys 480
    >Saws it in half
    >RX 240
  5. Agree
    duckwithanokhat got a reaction from sqeej in Red Army   
    Nice build but the name is kind of weird
  6. Informative
    duckwithanokhat reacted to Daveeede in What GPU to upgrade from gtx 950?   
    Definitely the GTX 1050/1050ti are more efficient but the performance on the RX 480 is much better. 4GB is adequate for 1080P gaming but more is better for certain AAA titles. There are some great black friday deals on 4GB 480's right now.
  7. Like
    duckwithanokhat got a reaction from AG1233 in Good anime?   
    I'll check out Another and Magi, I've pretty much watched the rest. Thanks for you time listing all of these.
  8. Like
    duckwithanokhat got a reaction from bgibbz in Graphics Card beginning to overheat to 85-90+   
    Like what he said, you can get a lot more performance with the latest gen GPUs for the price of a 960/970 or 980.
     
    The NZXT S340 is a pretty sweet $100 case. But if you don't exactly care for the aesthetics and more airflow, get a phanteks case that suits you, and you should be good. If you want a mix between quiet and air flow the fractal design S or r5 is not too bad.
  9. Agree
    duckwithanokhat got a reaction from RS2007GOD in Will intel ever enter the dedicated graphics card market?   
    If they stick to iGPUs, probably not.
     
    But if Intel decides to start making actual GPUs then I would be excited to see how well they do.
  10. Agree
    duckwithanokhat got a reaction from xDanielxOossiex in Will intel ever enter the dedicated graphics card market?   
    If they stick to iGPUs, probably not.
     
    But if Intel decides to start making actual GPUs then I would be excited to see how well they do.
  11. Like
    duckwithanokhat got a reaction from razor767 in Good Games to try out?   
    Thanks for the list, will try them out (already have Rocket League tho).
  12. Funny
    duckwithanokhat reacted to TheRandomness in HELP   
    All armour editions.
  13. Like
    duckwithanokhat reacted to KennDinVen in HELP   
    thx dude
     
  14. Agree
    duckwithanokhat got a reaction from FirstM8 in What happened to LTT upload schedule?   
    Hey @nicklmg I noticed you guys don't do late night uploads anymore. You guys change the upload schedule? I don't mind it, just wanna know what time I can look out for another vid. If someone has already asked about this, please direct me to the post .
  15. Like
    duckwithanokhat got a reaction from uzarnom in How to return string to variable in C?   
    Finished my code already, I did end up using strcmp(), but appreciate the help anyways.
  16. Like
    duckwithanokhat got a reaction from beingGamer in C function code help.   
    Hallelujah! I did it again with only 2 functions this time (technically 4, I had 1 for input, 1 for display), here is my code, please give me some feedback on it
    // // main.c // Lab 9 Test // #include <stdio.h> int input(int); int div_func(int, int); int mod_func(int, int); void display(int, int, int, int, int); int main() { //Declaring input variable int a; //This variable will be used only in calculations int b = 10000; //Variables to store digits for displaying int idigit1, idigit2, idigit3, idigit4, idigit5, modres1, modres2, modres3, modres4; //Input a = input(a); //Calculations idigit1 = div_func(a, b); modres1 = mod_func(a, b); //Divide the value of b by 10 each time the line is written to make correct calculations b /= 10; idigit2 = div_func(modres1, b); modres2 = mod_func(modres1, b); b /= 10; idigit3 = div_func(modres2, b); modres3 = mod_func(modres2, b); b /= 10; idigit4 = div_func(modres3, b); modres4 = mod_func(modres3, b); b /= 10; idigit5 = div_func(modres4, b); display(idigit1, idigit2, idigit3, idigit4, idigit5); system("pause"); return 0; } //Input int input(int value) { puts("Please input a value between 1 and 32767"); scanf("%d", &value); return(value); } //Division function int div_func(int a1, int b1) { //Variables to store calculations int storage; //Calculation storage = a1 / b1; return (storage); } //Modulus Function int mod_func(int a1, int mod_b) { //Variables to store calculations int mod_storage; //Calculation mod_storage = a1 % mod_b; return (mod_storage); } //Display Function void display(fdigit1, fdigit2, fdigit3, fdigit4, fdigit5) { printf("\n\nThe digits spread out are:\n%d %d %d %d %d\n", fdigit1, fdigit2, fdigit3, fdigit4, fdigit5); } Edit: I have a line: system ("pause"); That's just a codeblocks thing don't worry about it.
  17. Informative
    duckwithanokhat reacted to beingGamer in C function code help.   
    sure, but you will have to wait a bit.
    Will write and share once I reach home
    7-8 hours to go 
  18. Informative
    duckwithanokhat reacted to spenser_l in C function code help.   
    Definitely go over the problem with your teacher, it's important that your function can be applied to different inputs. That seems like too much to me.
     
    For reference, here is my solution in C (there are probably better ones since this does no input validation (1-32767), but for the simple case):
     
    #include <stdio.h> int int_div(int x, int y ) { return x / y; } int rem(int x, int y) { return x % y; } int* msd(int x) { int i = 0; int place = 10000; int remain = 0; static int output[5]; while (place >= 1) { output[i++] = int_div(x, place); remain = rem(x, place); place = place / 10; if (remain != 0) { x = remain; } } return output; } int main() { int *p; int i; p = msd(4562); for ( i = 0; i < 5; i++ ) { printf("%d ", *(p + i)); } printf("\n"); return 0; }  
    Please don't just copy this, it won't help your learning. Definitely talk to your teacher about how you can improve the code that you wrote.
  19. Like
    duckwithanokhat got a reaction from SnowyMus in C function code help.   
    Hallelujah! I did it!!!! It took me so long, thank you for telling me what to do guys  .
     
    Edit: Although I am going to ask my teacher about the efficiency of my code because I ended up making 12 functions and 11 variables...
  20. Like
    duckwithanokhat got a reaction from beingGamer in C function code help.   
    Hallelujah! I did it!!!! It took me so long, thank you for telling me what to do guys  .
     
    Edit: Although I am going to ask my teacher about the efficiency of my code because I ended up making 12 functions and 11 variables...
  21. Like
    duckwithanokhat got a reaction from spenser_l in C function code help.   
    Hallelujah! I did it!!!! It took me so long, thank you for telling me what to do guys  .
     
    Edit: Although I am going to ask my teacher about the efficiency of my code because I ended up making 12 functions and 11 variables...
  22. Informative
    duckwithanokhat reacted to 79wjd in Code help.   
    There's no intelligent way to do it without an if....so I'm sure you can use an if statement. 
     
    Its simple: 

    if(statement == true){     do this; } else {       do this;  }
     
    A store credit -- you have x amount that you're allowed to spend until you pay it off. 
  23. Like
    duckwithanokhat got a reaction from LionWaffles in What do you guys think about the new users?   
    I mean I wouldn't call myself a "vet" or whatever, but I've used this forum well before the giveaway and to be honest, it makes me kind of sad when I see people make an account just to enter the giveaway and then never visit this site again.
  24. Agree
    duckwithanokhat got a reaction from Hackentosher in What do you guys think about the new users?   
    I mean I wouldn't call myself a "vet" or whatever, but I've used this forum well before the giveaway and to be honest, it makes me kind of sad when I see people make an account just to enter the giveaway and then never visit this site again.
  25. Funny
    duckwithanokhat got a reaction from amasuke55 in What do you guys think about the new users?   
    I mean I wouldn't call myself a "vet" or whatever, but I've used this forum well before the giveaway and to be honest, it makes me kind of sad when I see people make an account just to enter the giveaway and then never visit this site again.
×