1,265 Posted Topics

Member Avatar for bwjones

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 …

Member Avatar for WaltP
0
101
Member Avatar for matt999tye

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.

Member Avatar for matt999tye
0
118
Member Avatar for KimJack
Member Avatar for crazylunatic

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]

Member Avatar for jephthah
0
124
Member Avatar for kishan4every1

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 …

Member Avatar for jephthah
0
105
Member Avatar for Gerritt

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 …

Member Avatar for jephthah
0
118
Member Avatar for COLLIESA

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 …

Member Avatar for jephthah
0
155
Member Avatar for newport

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 …

Member Avatar for jephthah
0
103
Member Avatar for wollacott

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 …

Member Avatar for jephthah
0
122
Member Avatar for smiles
Member Avatar for wolverine_ramir

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); } …

Member Avatar for John A
0
152
Member Avatar for hallinan

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.

Member Avatar for zhelih
0
141
Member Avatar for jephthah

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 …

Member Avatar for zandiago
0
115
Member Avatar for fskhan
Member Avatar for jephthah
0
3K
Member Avatar for wollacott

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 …

Member Avatar for jephthah
0
132

The End.