User Profile
Collapse
-
i < 5 does not run 5 times. means i will always be less than 5. -
Well I know I wasnt specific but the exercise for chapter does not use use switch and case yet. So id like do it without case.Leave a comment:
-
Because you have 6 letters but you only looped 5 times. When you use arrays it counts 0 as 1 so when we set =< it went up to 5. 012345 for the array. But the loop for int starts at 1 excluding the 0.Leave a comment:
-
an array you start from 0 but and integer starts at 1...like counting your fingersLeave a comment:
-
-
Because your using less than 5 and so it only goes to 4. So make it less than or equal to 5.Leave a comment:
-
I have not used case and switch or pointers just yet. The headers I've only used are string.h,stdio. h,and ctype.h.Leave a comment:
-
-
Need help converting a hexidecimal to integer
...Code:#include<stdio.h> #include<ctype.h> main() { int c; /*Function converts string of hexadecimal digits to int */ int htoi(char s[]){ int i = 0; while((c == getchar()) != EOF) { if(isdigit(c) == '0') /*then*/ { if(c == 'x' || c == 'X') /*then */ { /*then -
The whole point of this exercise was to use to start using diffrent header files for the first time. In the book INT is +/- 32767, UINT is 65535. Which when your a beginner and you get numbers not intended you begin to think your doing something wrong. When I fixed everything, INT was still 32 bits and UINT was same size as ULONG which as you can see from the numbers. They're 16 bit in the book that's all.Leave a comment:
-
Idk their much bigger than indicated in the book, but the book is old. I went to wikipedia https://en.wikipedia.org/wiki/C_data_types to correct each one and size is not changing so that must be the size. Int is 16 to 32 bits and not necessarily the same size as long but in the case it looks like they are. Thanks for the input.Leave a comment:
-
Printing datatypes problem
My program is just printing ranges but the unsigned integer is not working. The max is suppose to be 65535. And also integer is messed up. And also long is. I'm new to programming and books can be vague.
C:\Documents and Settings\Mikes\ Desktop\Cprog>g cc Datatypes.c -o Datatypes.exe
C:\Documents and Settings\Mikes\ Desktop\Cprog>D atatypes
Character min: -128
Character max: 127
...
No activity results to display
Show More
Leave a comment: