User Profile

Collapse

Profile Sidebar

Collapse
touqra
touqra
Last Activity: Jul 17 '07, 07:21 AM
Joined: Jun 27 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • touqra
    started a topic char* and char
    in C

    char* and char

    I am confused between things like char* v and char v, and how to use them.
    I heard that C++ doesn't use things like char* v. Is that true ?
    See more | Go to post

  • touqra
    replied to Parameter not working
    in C
    oops...I forgot to write the file.open line when I typed this post.
    Initially, I read that new can be used to provide a varying memory size for the pointer it's refering to. So, that's why I wrote str = new char; How then should I use new ?

    If my code is only allocating one byte space for str, I don't understand how I could manage to cout 123. If it's one byte, shouldn't it cout 1 ? And why should a pointer read less one byte...
    See more | Go to post

    Leave a comment:


  • touqra
    started a topic Parameter not working
    in C

    Parameter not working

    I have written a C++ as I learn C++ along, and the funny thing is that this C++ I wrote, just have to open a txt file, and reads it and cout the content.
    The txt file (new.txt) content is 12345.
    But the output that I got once compiled was 123. I can't figure out why 45 doesn't appear. If I revert to char str[12]; it outputs 12345. I dunno what's wrong with my code below:

    #include <iostream>
    #include <fstream>...
    See more | Go to post
No activity results to display
Show More
Working...