Skip to main content
2 votes
Accepted

How does HEAD in linked list work?

Your question is unclear, but I'll take a shot at it. In a linked list, HEAD is usually a var name, not a data type. HEAD is usually a pointer or possibly a data structure that serves as the pointer ...
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

Segmentation fault: Data types for key and entered text by user while program operated through CLI

The program does not validate the number of arguments passed to it, therefore if program is run with none or one argument, it will fail on one of the atoi calls. From the spec: If your program is ...
DinoCoderSaurus's user avatar
1 vote
Accepted

Filter - Structures & Headers

The code knows how long each structure element is, thanks to the definition in the header file, so it only needs to add the appropriate number of bytes to the starting address to get to anything. The ...
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

ProblemSet1 - Another Credit.c issue - Can't convert the floating value of my variables into an integer value

Having problems with this? temp_b /= (10 ^ 14); That would be because the ^ operator is not an exponent operator as it is in mathematics. It's the exclusive or operator. You might try a call to pow()....
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

datatype string is malfunctioning in pset2 2020

According to the man page, printf returns an int Return value Upon successful return, these functions return the number of characters printed (excluding the null byte used to end output to ...
DinoCoderSaurus's user avatar
1 vote
Accepted

Return type of printf in C

you are right, in fact the printf function return value is as follows: Return Value On success, the total number of characters written is returned. If a writing error occurs, the error ...
MARS's user avatar
  • 5,169
1 vote
Accepted

pset1 credit.c – is this a data type conversion error?

int chopoffend(long long n) int in C is 4 bytes max, that is 2^32 -> 10 digits max
obesman's user avatar
  • 1,139
1 vote
Accepted

Limits of data type as explained in Week-1

The problem is how numbers are stored. A computer operates with a binary or base-2 number system. The real world operates in a base-10 system. The only fractional numbers that can be stored with ...
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

Pset4 recover: can't seem to use struct to identify the jpg

You're overthinking this. A struct is not necessary here. Why not try storing your identifiers in an array instead?
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

C data types and format specifiers

INT02-C. Understand integer conversion rules Conversions can occur explicitly as the result of a cast or implicitly as required by an operation. Although conversions are generally required ...
Yuri Laguardia's user avatar
1 vote

C data types and format specifiers

Looks like C is (internally) casting the constant 2 (or probably more correctly, the result of n - 2) as an int since that is the essential difference between the two printfs. You might search the ...
DinoCoderSaurus's user avatar
1 vote
Accepted

Pointers & Integer Arithmetic Question

you loop runs infinitely because num never reduces again when it is less than 9. but you else has problem. int mod(int *a, int num) { if (num/10 > 10) { int value = num % 10; ...
Wafeeq's user avatar
  • 549

Only top scored, non community-wiki answers of a minimum length are eligible