far pointer

whenever i run this code it gives an error saying
1
2
3
4
5
C:\Users\Mehak\Desktop\Untitled2.c||In function 'main':|
C:\Users\Mehak\Desktop\Untitled2.c|4|error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token|
C:\Users\Mehak\Desktop\Untitled2.c|4|error: 'scm' undeclared (first use in this function)|
C:\Users\Mehak\Desktop\Untitled2.c|4|note: each undeclared identifier is reported only once for each function it appears in|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 0 seconds) ===|

please help!
1
2
3
4
5
6
7
#include <stdio.h>
int main()
{
    char far *scm;
    printf("%d",sizeof(scm));
}
remove 'far'

Though if you want to get the size of char pointer, you can do sizeof(char*).
Last edited on
no actually i need this far pointer in a program thats y
closed account (z05DSL3A)
A far pointer is a pointer that points outside of a segment in a system with segmented architecture (think 16-bit x86). I would hazard a guess that you are not using such an computer/compiler.

Where are you getting your code from?
Huh, I didn't know far pointers were even a thing. From what I've found, they aren't supported in modern compilers, which is why you got the errors you did.
Topic archived. No new replies allowed.