1,265 Posted Topics
Re: and here's a bunch more: [code]= += -= *= /= %= <<= >>= &= ^= |=[/code] "a *= 4 " is the same as "a = a * 4" "b <<= 1" is the same as "b = b << 1". in other words, multiply 'a' by 4 and put … | |
Re: this is about the weirdest homework question ive ever come across.. XOR is the only two-way function so could only be the possible answer. but thats a ridiculous way to handle addressing. it requires that one half basically be constant. | |
Re: use the perl command utime( ) to change the timestamp of the file to be whatever you want. [URL="http://www.perl.com/doc/manual/html/pod/perlfunc/utime.html"]http://www.perl.com/doc/manual/html/pod/perlfunc/utime.html[/URL] | |
Re: I'm asuming you already understand the relationship between hexadecimal(base16), decimal(base10), and binary (base2), and that any integer value can be represented simultaneously by either of these systems. LINE 8: the hexadecimal value "8000" in binary looks like this "1000 0000 0000 0000" it is the "bit mask" that checks the … | |
Re: it's not being skipped. it's running, and doing exactly what you've told it to do. which, unfortunately, is not what you intended it to do. every time the "count" loop in main() is executed, it calls your subroutine. every time the subroutine is called, it sets "scrub = 0". scrub … | |
Re: strtok( ) is a good function for this. you tokenize each word based on "whitespace" so single_word = strtok(MyBuffer," ") is the first call and it returns to "single_word" the pointer to a string that is everything up to (and not including) the first whitespace. in other words, it points … | |
Re: do you mean you don't know how (or where) to declare the variable, "A"? to make a long story short, for now you can just try declaring it as a global variable (outside the "main( )" routine) like so: [code] int A[MAX_ROWS][MAX_COLS]; [/code] where MAX_ROWS and MAX_COLS can be #define'd … | |
Re: like Dragon said, you cant nest subroutines inside main, as you're doing. each function (including main) has to each be separate from each other. other than that, the problem you've identified is that you're trying to treat a single char variable ("menu") as an array of chars. i think the … | |
Re: the very basic basics of C file handling. [code=c] if ((fp = fopen(filename,"r"))==NULL) { printf("cannot open file `%s`\n",filename); exit (1); } while (fgets(buf,80,fp)) // this assumes text lines are less than 80 chars! { if (strstr(buf,"waldo") != NULL) { printf("found him!"); waldo++; } printf("I found waldo on %d lines.\n",waldo); } … | |
Re: yeah, you cant post 300 lines of code and expect people to sift through it. even if it didnt wrap across line breaks. try parse out your specific questions, and make a simple example of what your main (or first) problem is. then work from there. | |
hi, my name is Rob I live in Seattle and I'm an engineer for a large medical device company. I know enough C and a few other languages to get myself in trouble. I found this site by accident (google search) and after reading a few posts, I thought I'd … | |
Re: [QUOTE]As the OP hasn't responded[/QUOTE] thats cause yall scared him away | |
Re: you have the right idea so far. your switch is (correctly) operating as conditional on the "paytype" but why, within each case, are you trying to assign values to the "paytype" variable? each case should be asking for the type of payment that is appropriate for the pay type, and … |
The End.