User Profile

Collapse

Profile Sidebar

Collapse
dynamicleo
dynamicleo
Last Activity: Oct 13 '06, 06:09 AM
Joined: Oct 11 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dynamicleo
    replied to Need help - Nested Loops
    in C
    Code:
    for (int i = 1; i <= 10; i++) {
    
        for (int j = 1; j <= 10; j++)
            cout<< ( j < i ? ' ' : '*' );
    
        cout<< '\n';
    }
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Integer Parameters
    in C
    Code:
    int min( int x, int y) {
        return x < y ? x : y;
    }
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to int in C++ (newbie)
    in C
    You can used this way:
    Code:
    #include <iostream>
    
    #include "math.h"
    using namespace std;
    
    void add_number(int &a, int &b, int &c)
    {
        cout << "enter a" << endl;
        cin >>a;
        
        cout << "enter b "<< endl;
        cin >> b;
    
        c = a + b;
        // return (a,
    ...
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to array initlisation
    in C
    You can use as below:
    Code:
    float MATRIX2D_1[3][3] = { {1/9,-1/9,1/9}, {1/9,-1/9,1/9}, {1/9,-1/9,1/9} };
    
    or
    
    float MATRIX2D_1[3][3] = { 1/9, -1/9, 1/9, 1/9, -1/9, 1/9, 1/9, -1/9, 1/9 };
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Nested Loop.. again
    in C
    Thank!
    D_C
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Virtual Function override
    in C
    base pointer can point to derive instant, but derive pointer can not point to base instant
    eg: base * bptr = new derive( ); // valid
    derive * dptr = new base( ); // invalid

    you can write these ways:

    base * bptr = new bptr( );
    base * bptr = new dptr( );
    derive * dptr = new dptr( );

    you have these inheritance as following:

    class base {
    public:
    ...
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Error when using "bool" type
    in C
    bool is not premitive type in C and some C++ version

    if you want to use bool data type, you define as following:

    typedef enum bool { false, true };

    and then you can use as following:

    bool isEqual(bool, bool);

    bool logicValue = true;
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Too many arguments to function
    in C
    You defined a function with two parameters as following:
    int sum (int, int);

    but you call this function with three or more arguments as following:

    s = sum(100, 200, 300);

    or

    s = sum(10, 20, .....);

    in this case too many arguments to function error will occure.
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Integer Variables
    in C
    min = x;

    if (min > y) min = y;

    if (min > z) min = z;
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to programming help
    in C
    #include<iostre am.h>
    #include<conio. h>

    void main(){
    clrscr();

    for (int i = 1; i <= 5; i++){

    for(int j = i; j <= 5; j++)
    cout<< "*";

    cout<< endl;

    }
    getch();
    }
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to programming help
    in C
    #include<iostre am.h>
    void main(){
    for (int i = 1; i <= 5; i++){
    for(int j = i; j <= 5; j++)
    cout<< "*";
    cout<< endl;
    }
    }
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Nested Loop.. again
    in C
    for (int i = 1; i <= 10; i++){
    for (int j = i; i < 10; i++)
    cout<< " ";
    for (j=1; j<=i; j++)
    cout<< "*";
    cout<< "\n";
    }
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to Palindromes
    in C
    if( strcmp( sourceStr, strrev(sourceSt r) == 0 )
    cout<< "This string is palindromes";
    else
    cout<< "This string is not palindromes";
    See more | Go to post

    Leave a comment:


  • dynamicleo
    replied to for loop
    in C
    int i, result = 0, lo = 10, hi = 20;
    for (i=lo; i<=hi; i++){
    result += i;
    }...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...