User Profile

Collapse

Profile Sidebar

Collapse
mmk
mmk
Last Activity: Jun 18 '08, 01:31 AM
Joined: Oct 5 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • mmk
    replied to stopping a running program
    in C
    Sorry in above mentioned answer, $ps -ef is linux command to display snapshot of current processes not processor.
    See more | Go to post

    Leave a comment:


  • mmk
    replied to stopping a running program
    in C
    You can get PID by typing $ps -ef in your linux terminal. Which shows the processors list which are currently running. Second column in the displayed table is PID. Just grep the processes pid you want to kill and kill it as stated by Raghu....
    See more | Go to post

    Leave a comment:


  • mmk
    replied to How to configure gdb ?
    in C
    Hi Ashit,

    Thank you, I got it :)....
    See more | Go to post

    Leave a comment:


  • mmk
    started a topic How to configure gdb ?
    in C

    How to configure gdb ?

    Hi,

    I have implemented strcpy function using arrays. Wantedly i have coded in order to generate segmentation fault. How to debug it using gdb ?

    My code snippet :
    Code:
    #include <stdio.h>
    #include <string.h>
    
    int main()
    {
        int i;
        char *dest="murali";
        char *src = "krishna";
        strcpy_temp(dest,src);
        printf("value
    ...
    See more | Go to post

  • Sorry i forgot "string to replace" in data structure and in logic . Here modified algorithm

    Data structures required : newstr,tempstr, searchstring,re placestr,oldstr of string type

    1. Read line into "oldstr".
    2. Read the string to change into "serachstri ng".
    3. Now traverse from postion 0 to \n in oldstr searching for "searchstri ng". while traversing copy the contents...
    See more | Go to post

    Leave a comment:


  • Sorry i forgot "string to replace" in data structure and in logic . Here modified algorithm

    Data structures required : newstr,tempstr, searchstring,re placestr,oldstr of string type

    1. Read line into "oldstr".
    2. Read the string to change into "serachstri ng".
    3. Now traverse from postion 0 to \n in oldstr searching for "searchstri ng". while traversing copy the contents...
    See more | Go to post

    Leave a comment:


  • Even I have gon through the logic but its totally messed but. Anyway what Raghu suggest is great approach.

    One more approach can be.

    I assume the input string is a single line.

    Data structures required : newstr,tempstr, searchstring,ol dstr of string type

    1. Read line into "oldstr".
    2. Read the string to change into "serachstri ng".
    3. Now traverse from postion...
    See more | Go to post

    Leave a comment:


  • mmk
    replied to How to convert string into character array
    in C
    One doutbt I have, actually string means we say its an array of characters or character array. Is this question mean copying a string to an character array ? Can't we use strcpy for this ?

    Mmk...
    See more | Go to post

    Leave a comment:


  • Yes , Raghu is correct .

    The function pointer *fp can be declared as void (*fp)(int), which specifies both the return type (void) and the types of arguments (int) of the function. We then assign the pointer to a particular function, and having done so, can then call the function just as we normally would....
    See more | Go to post

    Leave a comment:


  • mmk
    replied to basic questions
    in C
    4) what does a cin.ignore() command do?

    cin.Ignore function will ignore, consume or pass by a character you specify. Theres two arguments to the ignore function.

    Heres the syntax: cin.ignore(num, delimChar); --You can use it with cin or your file object name .

    So if we said: cin.ignore(555, '#'); The ignore function stops reading and discarding characters once its consumed the num (555) of characters...
    See more | Go to post

    Leave a comment:


  • mmk
    replied to How to print vector element address ?
    in C
    Dear Ganon11,

    myvector is a vector object. As i know there is no size() member function in c++ concept. If I am wrong please correct me.

    Cheers,
    MMk...
    See more | Go to post

    Leave a comment:


  • mmk
    replied to How to print vector element address ?
    in C
    Hi Moox,

    This worked fine for me.

    Thank you and all who responded for my query.

    Cheers,
    Mmk...
    See more | Go to post

    Leave a comment:


  • mmk
    replied to creating an array in a function
    in C
    Hi rolan,

    I suggest you following code. Anyone please correct me if I am wrong.

    Code:
    int *getMatrix(int column, int row){
        int sparseMatrix =new int [column][row]; 
            ...
           return &sparseMatrix[0];
    }
    Thank you,
    Mmk...
    See more | Go to post

    Leave a comment:


  • Hi Mimimi while trying out your query, i coded in this way but its not working out. Can you please share your code snippet. Anybody can help out me regarding this.

    Code:
    #include <stdio.h>
    
    #define BUFSIZE 100
    
    char buf[BUFSIZE][BUFSIZE]={ 1,3,"Trying",2,4,"out",4,5,"something"};
    
    struct table_entry{
    int length;
    int offset;
    char *name;
    ...
    See more | Go to post

    Leave a comment:


  • mmk
    replied to How to print vector element address ?
    in C
    Dear raghu, i tried about what you have suggested. But, still I am facing the problem. Please suggest me how to resolve this.

    [code=cpp]
    // vector::begin
    #include <iostream>
    #include <vector>
    using namespace std;

    int main ()
    {
    vector<int> myvector;

    // Fill vector with 1 to 5 ... 3 times
    for (int i=1; i<=5; i++) myvector.push_b ack(i);...
    See more | Go to post

    Leave a comment:


  • mmk
    replied to Fist time useing C\C++
    in C
    I suggest you first go through any standard books to know more about basics. Once knowing the basic you can go through some tutorials on net. I prefer Kernigan and Ritche book for C-language and Bajarne stroustroup book for C++.
    See more | Go to post

    Leave a comment:


  • mmk
    started a topic How to print vector element address ?
    in C

    How to print vector element address ?

    Hi,

    Anyone can suggest me how to print vector element address in c++.

    Thank you,
    Murali
    See more | Go to post
No activity results to display
Show More
Working...