Thread: what am I doing wrong with this fseek?

  1. #31
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Let me save you some trouble.

    Visual C++

    Projects using the .NET framework are C++/CLI projects. If you are using it, you should know because you selected what kind of project you are making. At any rate, C++/CLI is not default behavior from the C/C++ compiler, as far as I know. I can say with certainty that a C project wouldn't be compiled with C++/CLI.

  2. #32
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > Salem, your code does not compile, the IDE(Code::Blocks) keeps saying that LARGE_INTEGER is an unknown type and so is HANDLE and that #ifdef is unterminated.
    Yeah, that's my fault.
    A severe over-estimation of your abilities.

    I just cobbled together some ideas to show the concept, and hoped you were far enough advanced to make sense of it (based on your "I want to write portable code").

    But since you're barely able to crawl (let alone fly), you need precise hand-holding every step of the way.

    printf("ENTER [path] file name.ext:\n");
    gets(file_name);
    "I felt a great disturbance in the Source, as if millions of voices suddenly cried out in terror and were suddenly silenced"
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #33
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    I saw the "gets" as well.

    Yucky.
    Fact - Beethoven wrote his first symphony in C

  4. #34
    Registered User
    Join Date
    Nov 2011
    Posts
    150
    Sorry Salem, I am just a beginner. Please pardon me.

  5. #35
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Salem View Post
    "I felt a great disturbance in the Source, as if millions of voices suddenly cried out in terror and were suddenly silenced"
    Sorry about the gets; I just Google for MinGW C example.
    FYI: I could not get MinGW to work with GetFileSizeEx call; it kept saying it was not prototyped right.
    Edit: I am 90% positive I was just missing a header or a correct define; but, gave up for Google tello.

    FAQ > Why gets() is bad / Buffer Overflows - Cprogramming.com

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What's wrong with my fseek() ?
    By barramundi9 in forum C Programming
    Replies: 5
    Last Post: 07-25-2011, 12:40 AM
  2. Reg. fseek
    By pokks in forum C Programming
    Replies: 1
    Last Post: 01-16-2006, 01:28 PM
  3. Help With fseek();
    By Explicit in forum C Programming
    Replies: 3
    Last Post: 05-26-2004, 08:40 PM
  4. fseek
    By Max in forum C Programming
    Replies: 5
    Last Post: 12-15-2003, 03:21 PM
  5. fseek ???
    By davie_scotland in forum C Programming
    Replies: 2
    Last Post: 02-19-2002, 06:13 PM