Thread: how to store chars one by one into pointer-to-pointer?

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    168

    how to store chars one by one into pointer-to-pointer?

    I want to store chars one bye one into pointer-to-poniter,
    the number of chars is very big.
    How can I do it?

    the chars are from the below file
    Code:
    12E3F
    1E34F
    34EF5
    As the position of 'E' or 'F' in input file, storing 'E' into pointer-to-pointer
    for example:
    the third char of the first line is 'E'.
    so
    Code:
    char **p;
    *(*p+2) = 'E'

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Why do you need to store them in a pointer-to-pointer? Do you know what a p2p is?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    168
    Quote Originally Posted by Elysia View Post
    Why do you need to store them in a pointer-to-pointer? Do you know what a p2p is?
    which structure to store the file as above

  4. #4
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    This is like your 5th repeat post on the same issue. The example code you posted at the end of your first post is wrong, and the program doing that would segfault immediately. You need to brush up on pointers a bit and STOP POSTING MULTIPLE THREADS ON THE SAME TOPIC.

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by Elysia View Post
    Why do you need to store them in a pointer-to-pointer? Do you know what a p2p is?
    My guess is that they're really trying to make a matrix.

    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well they do seem to ignore every actual attempt to fix their broken code, so I lost interest.
    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.

  7. #7
    Registered User
    Join Date
    Aug 2009
    Posts
    168
    Quote Originally Posted by claudiu View Post
    This is like your 5th repeat post on the same issue. The example code you posted at the end of your first post is wrong, and the program doing that would segfault immediately. You need to brush up on pointers a bit and STOP POSTING MULTIPLE THREADS ON THE SAME TOPIC.
    I don't know how to load big input file into memory,
    can you give me a help?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why does C need pointer conversion
    By password636 in forum C Programming
    Replies: 2
    Last Post: 04-10-2009, 07:33 AM
  2. What is a virtual function pointer?
    By ting in forum C++ Programming
    Replies: 4
    Last Post: 03-05-2008, 02:36 AM
  3. Ban pointers or references on classes?
    By Elysia in forum C++ Programming
    Replies: 89
    Last Post: 10-30-2007, 03:20 AM
  4. Question About Pointer To Pointer
    By BlitzPackage in forum C++ Programming
    Replies: 2
    Last Post: 09-19-2005, 10:19 PM
  5. Another Linked List plee
    By Dragoncaster131 in forum C Programming
    Replies: 3
    Last Post: 05-15-2004, 05:40 PM