775 Posted Topics
Re: [QUOTE=jahanruhi3@gmai;1778850]i am having the problem with resul set could u pls help me out[/QUOTE] @jahanruhi3@gmai Start your own thread if you need help with yours | |
Re: there would be a segmentation fault at line 195 cause you did not initialize the values of i and j | |
Re: [QUOTE] help plz, i am trying to input some names and then output them[/QUOTE] I suggest using a 2D character array @ line 12: 1. array indexes start at 0 2. since your not using files why use EOF? do yo expect that the user would input a negative value? … | |
Re: 1. Don't use goto statements read this thread: [URL="http://www.daniweb.com/software-development/cpp/threads/414344/1768131#post1768131"]http://www.daniweb.com/software-development/cpp/threads/414344/1768131#post1768131[/URL] 2. I suggest a boolean like statement that if it is a prime number it would print this printf("\nThe number you enter is a prime number!"); in an if else statement | |
Re: [CODE]contact *newnode; newnode = (contact*) malloc (sizeof(contact));[/CODE] | |
Re: [URL="http://www.daniweb.com/software-development/cpp/threads/78223"]read this[/URL] and [URL="http://catb.org/~esr/faqs/smart-questions.html"]this[/URL] | |
Re: The error says it all the factorial method is missing a return statement the return n should be outside of the else statement or maybe put one before the ending bracket of the method ![]() | |
Re: [QUOTE]How should I improve the code?[/QUOTE] how about using the isdigit() or read the input as string then check it using strtol function Here's a good example a found [URL="http://stackoverflow.com/questions/3403632/check-if-user-input-a-float-to-a-int-var"]http://stackoverflow.com/questions/3403632/check-if-user-input-a-float-to-a-int-var[/URL] | |
Re: okay before we give more help what have you researched so far did you try to google search about the topic? [QUOTE]but i do not know any thing in c can you write the code please.[/QUOTE] Sorry but no ones gonna serve you code here without doing your part forum … | |
Re: [QUOTE]How can I modify my struct so that I can make use of the email/address pointers to store a corresponding value (email/address) into it dynamically?[/QUOTE] Why do you need to modify struct when you can do something like this at main: [CODE] printf("Enter Name:"); scanf("%s",&email->name[40]); printf("Enter student ID:"); scanf("%s",&email->phone_number[9]);[/CODE] I … | |
Re: @ line 19: you mistook a while loop for a for loop @ line 26: you forgot to put << before year | |
Re: assign the value returned by computeArea() to variable area at main then pass the variables carpetPerfootcost and area and to the last function | |
Re: if you check the values of name[i] at line 15 you'll see that they're all null @ the Monitors class constructor try to use the parameters passed instead of assigning to itself also your exporting a non public type, try to make class Monitors public if it's not in the … | |
Re: atoi is used to convert a [B]string[/B] to an integer Quick question: why use atoi() on an integer? | |
Re: It checks the number of times a person has gotten in a specific group? | |
Re: I don't think there's really a [I]the best[/I] browser Lots of users have different opinions and taste as to what browser they would like to use often Now why do you ask, are you just asking for our opinions? Well I [I]personally[/I] think Google chrome is great in terms of … | |
Re: [QUOTE]where does counting starts in a link list, is it from 0 or 1.[/QUOTE] depends on whats the first input of item but I believe you used 1 actually this is the issue here: [CODE] if(i==loc)//if location is found { next_node=ptr->link;// ptr->link=new; new->link=next_node; }[/CODE] once the node with the same … | |
Re: [QUOTE]the files differ statement only occurs if the first word is different, otherwise it won't print the statement the files are equal statment occurs only if the first word for each file are the same[/QUOTE] [CODE]printf("files differ: word %d", wordCount); return 0;[/CODE] when you used the return statement, you ended … | |
Re: allocate memory using the new operator and save the address of that memory in the pointer. you can try it like this; [CODE]int* nums = NULL; // Pointer to int, initialize to nothing. int total; cin >> total; nums = new int[total]; for (int i=0; i<total; i++) { cout << … | |
Re: Other than the official oracle docs... Did you check the read me thread at the top of this forum? If you scroll down you'll see some tutorial links [URL="http://www.daniweb.com/software-development/java/threads/99132"]http://www.daniweb.com/software-development/java/threads/99132[/URL] | |
Re: [QUOTE=javanoob7697;1776371]I'm trying to build a program that has a user guess 4 random pegs in order. it needs to use arrays and methods and i'm struggling mightly... here are some parameters The structures must be declared as variables in the main() method. You must write your program so that the … | |
Re: [QUOTE] Also, what if I wanted to write a loop where each number is subtracted by one more than the one before it (100, 99, 97, 94, 90...)?[/QUOTE] use a counter that increments itself, then you use this counter to subtract the main variable | |
Re: Start the value of counter with the equivalent ascii value of a at the loop print out the char and int value of counter and then use the equivalent value of z as the loop condition | |
Re: Not really having a certificate means that your well versed with the languange It's just that you can't brag much about it when it comes to finding a job | |
Re: Did you try the suggestions posted? | |
Re: [QUOTE] I think i am using redundant code, is there anyway i can reduce it, if so how?[/QUOTE] That's the use of arrays, to make it less redundant and less complicated :) But since your not allowed to and if you have no more problems with the code then it … | |
Re: [QUOTE=irre;1767687][code=c] #include <stdio.h> void main() { int d,m,y; int days=0; int k; // return var printf("input date dd.mm.yyyy\n"); scanf("%d.%d.%d",&d,&m,&y); m--; switch(m) { case 11:days=30; case 10:days+=31; case 9:days+=30; case 8:days+=31; case 7:days+=31; case 6:days+=30; case 5:days+=31; case 4:days+=30; case 3:days+=31; case 2:if((!(y%4))&&(y%100)) days+=29; else if(!(y%400)) days+=29; else days+=28; case 1:days+=31; … | |
Re: After seeing his post above I now agree with caperjack, only thing is now it's not just the signature but the post as well | |
Re: I think I found your classmate with a similar problem [URL="http://www.daniweb.com/software-development/c/threads/413992"]http://www.daniweb.com/software-development/c/threads/413992[/URL] see the suggestions given there | |
Re: [QUOTE] got problem when i clicl the checkbox 0r radiobutton..when i compile there is no error[/QUOTE] Could you tell us what happens after you clicked either? [QUOTE]..and also how can i put the background image at my gui??[/QUOTE] Here's some links that might help [URL="http://www.java2s.com/Code/Java/Swing-JFC/Panelwithbackgroundimage.htm"]http://www.java2s.com/Code/Java/Swing-JFC/Panelwithbackgroundimage.htm[/URL] [URL="http://stackoverflow.com/questions/523767/how-to-set-background-image-in-java"]http://stackoverflow.com/questions/523767/how-to-set-background-image-in-java[/URL] | |
| |
Re: [QUOTE]error message comes up after the user input prompts come up. [/QUOTE] Could you post that error message here | |
Re: Why do it the hard way when there's already a constant for that in the math class (Math.PI) :icon_wink: Is this H.W. where your required to make your own? | |
Re: are you sure that the numbers in the file is always 10 digits? Next to simplify the reversing I think you'll need to use loop and manipulate the counter's value for the index | |
Re: [CODE]if (opr = '+','-','*','/','%','^')[/CODE] use the == operator for comparing values Divide into different statements and Compare opr with each operand and use || for all the statements comparing opr with a single operand to check if at least one of these statements is true | |
Re: [CODE]if(filename == "quit")[/CODE] use strcmp | |
Re: [QUOTE]Also, I try to test the while loops with negative or 0 inputs, and I get a repeat of the output which looks like this:[/QUOTE] Why not ask for the input again instead of just incrementing the value? [QUOTE]It doesn't display the 1 hour which it's supposed to be 50 … | |
Re: [QUOTE=MichaelCJ10;1773340]The array has to display 1-10 i mean rather than 0-9[/QUOTE] Add +1 to counter when printing | |
Re: [QUOTE=RTFMID10T;1773295]Reading through the forums and seeing some responses, why do people quote their titles?? I don't think they care for one and it would matter on your resume, but to fix an issue of a hardware issue or some software or network issue. Yea, ok i have a wallet of … | |
Re: Did you check if variable temp has enough memory to store those? | |
Re: what do you mean by unfix size array? in java arrays you'd still need to allocates memory for the elements can you be more specific or give an example about that? | |
Re: May we see the rest of the code before we jump to conclusions | |
Re: [QUOTE]how to print student who score less than 50.0 mark and who score A... number of students who scored less than 50.0 marks,Print out the information for all ten students and Given a student name (input by the user), print out all the information for that student......[/QUOTE] Traverse the struct … | |
Re: Edit: nevermind, sorry made a wrong post | |
![]() | Re: Hmmm... isn't it that the elements of deck have no value? so whats the use of line 16? |
Re: I tried the program and got it to work... Did you put the image in the same directory with the class files? are you sure that the image has the right filename and extension? |
The End.