Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. error while trying to uplaod the file in current directory using c language

error while trying to uplaod the file in current directory using c language

Scheduled Pinned Locked Moved ATL / WTL / STL
help
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raghvendrapanda
    wrote on last edited by
    #1

    Hi, i writing a code in c language in load runner to upload a file into the current directory using c.I am getting an error "operands of = have illegal types `pointer to char' and `int'" Below is my code:- char *current_dir = getcwd(); char *filename = "current_dir:\\EUR_PR_01302013.txt"; long file_stream; if ((file_stream = fopen(filename, "a+")) == NULL) //open file in append mode { lr_output_message("Unable to create %s", filename); return -1; } Any kind of help/suggestion will be appreciated. regards, raghvendra panda

    L _ 2 Replies Last reply
    0
    • R raghvendrapanda

      Hi, i writing a code in c language in load runner to upload a file into the current directory using c.I am getting an error "operands of = have illegal types `pointer to char' and `int'" Below is my code:- char *current_dir = getcwd(); char *filename = "current_dir:\\EUR_PR_01302013.txt"; long file_stream; if ((file_stream = fopen(filename, "a+")) == NULL) //open file in append mode { lr_output_message("Unable to create %s", filename); return -1; } Any kind of help/suggestion will be appreciated. regards, raghvendra panda

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Which line gives the error? And please use <pre> tags around your code.

      1 Reply Last reply
      0
      • R raghvendrapanda

        Hi, i writing a code in c language in load runner to upload a file into the current directory using c.I am getting an error "operands of = have illegal types `pointer to char' and `int'" Below is my code:- char *current_dir = getcwd(); char *filename = "current_dir:\\EUR_PR_01302013.txt"; long file_stream; if ((file_stream = fopen(filename, "a+")) == NULL) //open file in append mode { lr_output_message("Unable to create %s", filename); return -1; } Any kind of help/suggestion will be appreciated. regards, raghvendra panda

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        You have to format the filename string. Also need to allocate memory to it.

        char filename[1024];
        sprintf(filename, "%s\\EUR_PR_01302013.txt", current_dir);

        «_Superman_»  _I love work. It gives me something to do between weekends.

        _Microsoft MVP (Visual C++) (October 2009 - September 2013)

        Polymorphism in C

        J 1 Reply Last reply
        0
        • _ _Superman_

          You have to format the filename string. Also need to allocate memory to it.

          char filename[1024];
          sprintf(filename, "%s\\EUR_PR_01302013.txt", current_dir);

          «_Superman_»  _I love work. It gives me something to do between weekends.

          _Microsoft MVP (Visual C++) (October 2009 - September 2013)

          Polymorphism in C

          J Offline
          J Offline
          Jibesh
          wrote on last edited by
          #4

          after a long time seeing you here <>:thumbsup:

          Jibesh V P

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups