User Profile

Collapse

Profile Sidebar

Collapse
mmag
mmag
Last Activity: Aug 6 '14, 07:30 AM
Joined: Feb 3 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • i don't understand your way.if possible you write code.are you sure this a very hard problem?i thought a lot but for per algorithm i needed to temporary string or file.this is assistant's homework.it can't very hard.
    See more | Go to post

    Leave a comment:


  • mmag
    started a topic how to remove and replace some char in a file(in c++)?
    in C

    how to remove and replace some char in a file(in c++)?

    i want to remove some character in my file. too i want to replace some char to another. i know the easiest way for this job is we write final text in file. i mean we first produce sightly text then write it in file .i don't want use of temporary string.what do i do for solving this problem ?
    See more | Go to post

  • mmag
    started a topic how to subtract two string containing numbers?
    in C

    how to subtract two string containing numbers?

    hi.i have a code for subtract of two char arrays(size of each is 50).but i want to write this program with string and i should be consider that size of each string may be not equals.for example we have s1=4777 and s2=55.and we should be subtract them.this is my code.
    Code:
    char* sub(char x[50],char y[50])
    {
    int i,j,temp=0;
    char z[50]={'0'};
    for(i=0;i<50;i++)
    {
    z[i]='0';
    }
    for(i=49;i>=0;i--)
    ...
    See more | Go to post

  • mmag
    replied to show all subset of a sub
    in C
    my algorithm that is for per subset exists one number. these numbers are form 0 until (2^n)-1.allow me explain it with a example.
    n=3
    { } 000 0
    {1} 100 4
    {2} 010 2
    {3} 001 1
    {1,2} 110 6
    {1,3} 101 5
    {2,3} 011 3
    {1,2,3} 111 7
    The third column show some number(fn) that i use in code.now we know per number of subset has to state(sn).0 or 1. this means...
    See more | Go to post
    Last edited by Banfa; Feb 6 '14, 03:42 PM. Reason: Added [code]...[/code] tags

    Leave a comment:


  • mmag
    started a topic show all subset of a sub
    in C

    show all subset of a sub

    A program is a set of all subsets of this part of the show. Users can enter a number., For example, if n = 2 the output looks like this:
    {}
    {1}
    {2}
    {1,2}
    or for n=3 we have:
    {}
    {1}
    {2}
    {3}
    {1,2}
    {1,3}
    {2,3}
    {1,2,3}
    meantime this program should be solved with tow way.
    recursive function and Non-recursive.Can also be used in solving the problem...
    See more | Go to post

  • mmag
    started a topic How to define a dynamic 2D array
    in C

    How to define a dynamic 2D array

    my professor said one way for declaration dynamic 2d arrays.
    Code:
    int **a=new int *[m];
    int *x=new int[m*n];
    int *y=x;
    for(int j=0;j<m;j++)
    {
    a[j]=y;
    y+=n;
    }
    and i never understand this way.like what does y or x in this code.I want a person explain how works this code.if show with a image is better.thanks
    See more | Go to post
    Last edited by Rabbit; Feb 3 '14, 08:24 PM. Reason: Please use [CODE] and [/CODE] tags when posting code or formatted data.
No activity results to display
Show More
Working...