User Profile

Collapse

Profile Sidebar

Collapse
jinnejeevansai
jinnejeevansai
Last Activity: Jun 12 '17, 05:29 PM
Joined: Nov 1 '14
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • jinnejeevansai
    started a topic Sharing a variable between two c files
    in C

    Sharing a variable between two c files

    I am trying to share a variable between two c files

    common.h

    Code:
    extern char seq2[1000000];
    File1.c

    Code:
    #include "common.h"
    
    char seq2[1000000] = {0};
    void main(){}
    File2.c

    Code:
    #include "common.h"
    
    int main(){
    
    	if(seq2[0] != '.'){
    	  int j = 1;
    ...
    See more | Go to post

  • jinnejeevansai
    started a topic PriorityQueue not working properly
    in Java

    PriorityQueue not working properly

    I have made a priorityqueue which inserts objects and compares them with cost parameter ,when two costs are equal it should keep them in enqueued order,but i found after debugging one time it is in enqueued order and other time it is not in the order but i am not getting what is wrong with my code

    Code:
    /* package whatever; // don't place package name! */
    
    import java.util.*;
    import java.lang.*;
    import
    ...
    See more | Go to post

  • jinnejeevansai
    replied to best way to represent square root of 2
    in C
    But if i multiply sqrt(2) twice the answer is 2,in your case it is 1414*1414 = 1999396 which gives 1.999396 i want to have it exactly 2.000000 rounding off decreases precision as calculation increases and i don't want to round off.
    See more | Go to post

    Leave a comment:


  • jinnejeevansai
    started a topic best way to represent square root of 2
    in C

    best way to represent square root of 2

    I am writing a program which involves lot of computation and 10^-7 difference is also making solution highly different. Calculation mainly consists of multiplying number by squareroot of 2 and addition of some number. I want to represent squareroot of 2 in some efficient way than floating point representation as representing that way is making difference .Is there any other method to represent squareroot.
    See more | Go to post

  • how to find the path of shortest distance between two vertices in a graph using bfs

    It is also given that in case of a tie, a smaller indexed vertex should be preferable to a larger indexed vertex.


    First in my approach i traversed graph using bfs finding distances of all vertices from start node ,i got the path length from start to end node,then i traversed from end node to start node by viewing if the length of node is one less than previous,but i am missing some point in between when i submit my code it...
    See more | Go to post

  • why i am using the array arr only what is the problem
    See more | Go to post

    Leave a comment:


  • jinnejeevansai
    started a topic getting segmentation fault (core dumped)
    in C

    getting segmentation fault (core dumped)

    Hii,
    I was trying to implement hoffman codes generating program but i was getting runtime error due to function "printcodes " my problem was not to know reason for error but to write printcodes function to print the leaf nodes of the tree created by me with *root as the root node.I don't know if there is any error in huffman tree created by me.Someone please correct my code or atleast provide an easy code for huffman coding as the...
    See more | Go to post

  • jinnejeevansai
    started a topic unable to access variables
    in Java

    unable to access variables

    I was creating a swing applet if i make a seperate class of action listener i was unable to access extended class variables.Can someone explain my mistake and modify the code without merging two classes.


    Code:
    import javax.swing.*;
    import java.awt.*;
    public class Clock extends JApplet{
    JFrame frame;
    JPanel panel;
    JButton button;
    public void init(){
    frame = new JFrame();
    ...
    See more | Go to post

  • jinnejeevansai
    started a topic JPanel colour not changing
    in Java

    JPanel colour not changing

    I was writing a code to change the colour of frame continuously but it is not happening,Can someone point the mistake in my code.

    Code:
    import java.awt.*;
    import javax.swing.*;
    class cr{
            Color c[] = { Color.BLUE , Color.GREEN , Color.RED };
            int i=0;
            public void design()
            {
                    JFrame f = new JFrame();
                    f.setSize(200,200);
    ...
    See more | Go to post

  • jinnejeevansai
    started a topic problem with ImageIcon
    in Java

    problem with ImageIcon

    I was trying to put a image on jpanel but i was gettong a zoomed in image.Can someone tell how to make it clear.
    Actual image and screenshot of output are attached.

    Code:
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    class test1{
    public static void main(String args[])
    {
    JFrame f = new JFrame();
    f.setSize(1800,2880);
    ImageIcon i = new ImageIcon("background.jpg");
    ...
    See more | Go to post

  • jinnejeevansai
    started a topic Jpanel components not resizing
    in Java

    Jpanel components not resizing

    I was trying to make gui for a calculator i made it by drag and drop using netbeans ide but the components in it are not resizing according to the JFrame size,later i made by coding using JPanels but still they are not resizing .Can someone tell what to do to make the components resize according to JFrame.
    See more | Go to post

  • jinnejeevansai
    replied to problem with primes
    in Java
    Any other better algorithm by the way i think it was upto n not square root of n .
    See more | Go to post

    Leave a comment:


  • jinnejeevansai
    started a topic problem with primes
    in Java

    problem with primes

    Hii,i was trying to solve some problems in which i encountered one saying to find sum of digits of all prime numbers upto a number say n.I cannot solve it using normal method which is large.Can someone tell any logic to solve it.
    See more | Go to post

  • But i was printing a in fun
    See more | Go to post

    Leave a comment:


  • Can someone tell what is happening in the code

    Can someone tell why is variable a not getting printed.
    Code:
    import java.lang.*;
    import java.io.*;
    class t
    {
            int a=5;
            void fun()
            {
                    System.out.println(a);
            }
            public static void main(String args[])
            {
            }
            t()
            {
                    t var = new t();
                    var.fun();
    ...
    See more | Go to post

  • I got a doubt after you say,can you tell why the same error appears in the below code.

    Code:
    import java.util.*;
    class w1{
            public static void main(String args[]) throws java.lang.Exception
            {
                    int n=0;
                    ArrayList<Integer>[] al = (ArrayList<Integer>[])new ArrayList[n+1];
                    al[0].add(5);
            //      al[1].add(6);
    ...
    See more | Go to post

    Leave a comment:


  • Same error occurs after replacing object with integer
    See more | Go to post

    Leave a comment:


  • but i gave the input to a[j]
    See more | Go to post

    Leave a comment:


  • Can someone tell why my program is showing null pointer exception at line 33

    Hii,I was trying to solve a problem but i don't get why my program is showing null pointer exception on the commented line.Can someone explain the reason.
    Code:
    import java.util.*;
    class cod1{
            public static void main(String args[]) throws java.lang.Exception
            {
                    int t,i,n,j,k,p,q,r;
                    int[] a =new int[100000];
                    Scanner s = new Scanner(System.in);
    ...
    See more | Go to post

  • jinnejeevansai
    started a topic how to develop a animation
    in C

    how to develop a animation

    I was doing c programming and i want to make a code which can move animated objects using c.Can someone suggest such a software where i can create animation using c.
    See more | Go to post
No activity results to display
Show More
Working...