User Profile

Collapse

Profile Sidebar

Collapse
Extremist
Extremist
Last Activity: Jun 18 '07, 03:52 PM
Joined: Jan 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Extremist
    replied to access violation??
    in C
    if you comment out this ->
    Code:
    t=(temp[0]&temp[1]&temp[2]&temp[3]);
    then it compiles

    Go look at that
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to output
    in C
    Output

    danger
    count = 5
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to Double Pointers
    in C
    Oh, thank you soooo much!!!!
    You really helped me!!! I'm really greatful!
    I've been struggling somehow with this, so thank you

    Zel ;)
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to Please help me for segmentation fault
    in C
    Hi, try allocating some memory in your main program
    For instance
    Code:
    int *pCount = new int;
    but do that for all the pointers you are about to use
    Don't forget to say
    Code:
     delete pCount;
    deallocating all of the memory you allocated with the 'new' operator to prevent memory leakages
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to programming with array
    in C
    here is a nice place to start
    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
            //complete - Let user read a set of numbers from the keyboard
           // Complete - Code for finding the smallest element...
            return 0;
    }
    In short, try it first yourself ;)
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to how to pass a 2D array to a function C++
    in C
    Please remember CODE tags

    I'm not really seeing what you are asking, or what your code is doing
    I would suggest that you get to know pointers first
    You are asking how to pass a 2D array to a function C++
    Wel, here is some code for that

    First declare a 2D array
    Code:
    int ht=0, wd=0;
        cout << "Please enter the size of the array:  " << endl;
        cin >>
    ...
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to Difference between this TWO
    in C
    With an int in a normal C++ program, you can assign a value to the int by doing:
    Code:
    int a(5);
    The second one is just another way to assign values to private variables in a class. Same way as mentioned above
    They are the same, just different syntax
    See more | Go to post

    Leave a comment:


  • Hmmm... what do you want to know?
    Be a bit more specific
    Are you looking for something like this?
    Code:
    virtual void someFunction() = 0;
    See more | Go to post

    Leave a comment:


  • I know that when using normal C++ and header files, getting that error would indicate that the file just doesn't see the source .cpp file
    So just include that
    #include "file.cpp"
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to Double Pointers
    in C
    Ok...
    I did that

    I get a segmentation fault

    I have established that if only saying
    Code:
    char *pointer[50];
    works nicely, but I was just wondering
    Thanx for your input though.

    PS I'm also used to C myself...
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to I want to write a funtion
    in C
    Basic c++ syntax, you got it confused with Python
    Code:
    void myFunction()
    {
             cout << "Test" ;
    }
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to is the output correct
    in C
    The output of your code will be 0;
    The while will continue until n = 0;

    n = 20 while makes n = 10
    n = 10 while makes n = 5
    n = 5 while makes n = 2
    n = 2 while makes n = 1
    n = 1 while makes n = 0

    perhaps what you mean to do is:

    Code:
    int n = 20;
        while(n>0)
        {
            n/=2;
    ...
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to solve the problem and enjoy........
    in C
    I'm not sure what the problem is.
    It's so easy. It took me 10 minutes. Really man, try it first and then you'll be able to get much help with it. It's not very hard
    See more | Go to post

    Leave a comment:


  • Extremist
    started a topic Double Pointers
    in C

    Double Pointers

    Hi there

    I program in Linux, C++.

    If you declare a char pointer in C++ , you would say
    Code:
    char *pointer;
    And if you want to allocate memory for that pointer you would say
    Code:
    pointer = new char[50];
    Now, if I want to declare a double pointer
    Code:
    char **pointer;
    How would you allocate memory for such a double pointer?
    See more | Go to post

  • Extremist
    replied to C in Linux
    in C
    You're not giving anything here, the moment that you give more details and add some of your own attempts, we will be able to help you.
    So add the code you've already written...
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to reading the contents of a file in c++
    in C
    Code:
    #include <fstream>
    #include <string>
    ifstream file("filename.txt");
    
    string bla;
    if(file.fopen() != NULL)
    {  
          while(! file.eof()) 
         { 
                   getline(file,bla);
                   std::cout << bla << std::endl;
        }
    }
    There is a basic idea, if you have errors, just go and to cplusplus.com...
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to Compiling issues in Windows Vista with Turbo C
    in C
    Wel, Are you in windows or in linux?
    In what editor are you working?

    In Windows:
    I would suggest running it in command prompt for those purposes
    Start - > Run -> Enter "cmd" in the white block
    go to the directory of your compiled file, cd , and then just enter the
    compiled program 's name and press enter

    In Linux:
    Open a terminal,...
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to what does this mean
    in C
    In the first part, you are declaring a pointer to a map object...
    Thus, arg will be an existing pointer to another map object....
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to fread() on a bad disk?
    in C
    Code:
    mbr = fopen(fullpath, "r");
            if (!mbr) {
                    fprintf(stderr, "VxVM ERROR V-5-3-000: Can't open device %s
    \n",
                            fullpath);
                    return 0;
            }
    
            count = fread(buffer, 1, 512, mbr);
            if (count < 512) {
                      return and print error
            }
    Remember...
    See more | Go to post

    Leave a comment:


  • Extremist
    replied to Hİ everybody,
    in C
    Hi there

    int *a[20] would mean a pointer to an array of 20 ints

    int (*a)[20] would mean an array of 20 pointers to ints...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...