519 Posted Topics
Re: [url]http://www.google.com/search?hl=&q=gaussian+elimination+c%2B%2B&sourceid=navclient-ff&rlz=1B3GGGL_enIN258IN259&ie=UTF-8&aq=7&oq=gaussian+elimination+[/url] Maybe you should have a look here as well | |
Re: What do you mean by the prototype of error. Can you explain a little bit more, what is that you want. | |
Re: Works fine for me. This is the output that I got when I ran the code [CODE]please enter value x,y for top left10 please enter value x,y for bottom right20 please enter value x,y for point30 point 30, is outside rectangleplease enter value x,y for top left15 please enter value … | |
Re: In the first look there seems to be a problem in the way you create the linked list. According to what I think, you dont have a head pointer. What is the name of the pointer which points to the head of the linked list ? | |
Re: Check the parameters that you are passing when you call the function damagecalculate and then check how you have defined the function PS: Do you actually need to pass so many parameters into a function. You are bound to make a mistake. Cant you roll them up into a struct … | |
Re: [QUOTE]Looking mathematically, this approach is clearly wrong, cause factorization involves decomposition of number into PRIMES and not into other numbers (such as 9 etc.). So checking division with non-prime mathematically doesn't make any sense. [url]http://mathworld.wolfram.com/PrimeFactorization.html[/url] [/QUOTE] Mathematically also this approach is not wrong. As I explained in the above post … | |
Re: What exactly do you mean by hashtable of pairs. Based on what I understood from your description, you need a generic implementation of maps. As I see that you have made efforts (also it may be the case that I have misunderstood your problem and the code is completely useless … | |
Re: If your code is huge then break it into functions If you have to pass some parameters to the functions, passing them by pointers has an advantage that you can manipulate the value of the string inside the function Does this answer your question ?If not phrase it differently. As … | |
Re: When you declare an array, you need to give the size of the array [CODE]int main() { int arr[]; cin.get(); return 0; } [/CODE] Also how is the array getting its values. In post 1 the code you posted, the buy and sell bids were stored in objects in the … | |
Re: When the value of the variable letter is 65, the alphabet A is displayed. When the value is 90 the variable Z is displayed. At this time the value of counter is 26. The for the values 91-96 there is no display. Then the value of letter becomes 97. Counter … | |
Re: [QUOTE=skypower;1220959]Hello, I am having some strings grammar problems. Also by the way, [CODE] data = fopen("C:\\Program Files (x86)\\CodeBlocks\\mydata.dat","rb"); if (data == NULL)[/CODE] the data isn't getting NULL, even the file doesn't exist![/QUOTE] Try to read the contents of the file. If you are able to read and print the contents … | |
Re: Can you post how you have declared matchedAsk and ask vectors ? Also towards the ending in the for[line 48] loop, I notice that you are not changing the value of the index y. Is that what you want ? | |
Re: In the main function when you call getData, the array m_t is not declared anywhere .Either make this array global or pass a pointer (reference to this array) to the getData function | |
Re: I think the problem is in the main function .... I notice from the code that you have posted in post 1 you are calling search twice... Can you post an updated version of your main function. | |
Re: [QUOTE=barevhayerable;1220629][CODE] //put meshok1 to gumareli_1, meshok2 to gumareli_2 and then plus it //using atoi functions ok? //could you? //don't forget to type discription plz //and if you want add me to google friend(zz follow) list "Mikael Arakelyan" }[/CODE][/QUOTE] No..... But tell you what here is an example of how to … | |
Re: Dude why have you used integer(double) arrays instead of integers and doubles ? Also make a display function in your class. It will help you a lot to debug | |
Re: Is this code a function in some program ? Otherwise you really dont need to stract the strings. Just print them in the correct order | |
Re: If you can buy a book, buy "Pointers in C" by Yashwant Kanitkar . | |
Re: What help do you want ? | |
Re: Why are you just passing a void pointer. Why cant you pass the file pointers to the filecopy function ? | |
Re: Adding further to the what UncleLeroy has stated If you have some code of this sort [CODE]char* str= "ABCDEF"; str[1]='A'; [/CODE] You will get a seg fault. I THINK that is because the string "ABCDEF" is stored in the code section of the process and any attempt to modify it … | |
Re: This is what I think When you called malloc, you called it individually on each element in the array of pointers. So extending the same logic, when you call free, you have to call it on each element in the array. Corrections to this post are invited | |
Re: Maybe something of this sort [CODE]int i=0; long int bin=0; while(i<8) { bin= bin+ rem[i]*(pow(10,i)); i++; }[/CODE] | |
Re: You are on the right track but your implementation can be made more efficient. I have written down some sample code for you. So if you want to find the prime factorization of 12 the call to the function will be primeFactors(12,v1,2); [CODE]void primeFactors(int num,vector<int>& v1,int start) { int i=0; … | |
Re: I dont think you code is logically correct. If I give the input as 4, the successive values of rem will be 0,0,1. But the final value in ans will just 1. So in the 2 while loop you will just get 1 as the answer. The usual method used … | |
Re: SpinLock- If a process cant get a particular resource it keeps continuously checking to see when the resource becomes available. Context switch does not take place. This would be useful in cases where context switch takes much more time than the actual computation done by the process Mutexes- If a … | |
Re: The reason why you are getting endless loops is because when you re arrange the pointers, the list becomes circular( Work out your code on a piece of paper if you dont believe me) . Another solution could be to delete the node(totally disconnect it from the list) and then … | |
Re: Also to run the executable you have to type ./a.out google for the functions fread, fwrite... This will help you get started | |
Re: @choragos ... Check out the strtok function.... I think that might solve your problem.... | |
Re: When you display your tree in line 66, is there any problem there ? | |
Re: What do you mean when you say "denote addition" ? Check out strtok(), atoi() you may find it useful to extract numbers from the string | |
Re: [QUOTE=Xufyan;1209482]ok ! suppose i entered values for num[i] : 2, 5 , 7, 9, 3 the program first check every value with the value inside the loop j ? which means it will check with the next value of num[i] ? for example, here first value for num[i] is 2 … | |
Re: You could save the code to a different file and try running it there .... | |
| |
Re: Do you mean access the data members of the class policeOfficer ? You have to use the get/set methods defined in the class policeOfficer In the main function you have used the get/ set methods in for the class Parked Car.... Use that for example | |
Re: When you are using printf statements in the sin2() function, you print one value, using the %c specifier and the other using the %d specifier .... Is there any reason for that ? Also I am not able to clearly understand what you are trying to do. Is this the … | |
Re: [QUOTE]I have file(.txt) that the program reads on and it outputs the words aphabetically and if the word has been seen, it adds a count to it[/QUOTE] This is being done with which data structure ? If you want to use the binary tree for counting the frequency of the … | |
Re: [QUOTE=antra1234;1208156]char *default message[]="hghgghjgh" char *message=defaultmessage tis line showing error as 'initializing':cannot convert from 'const char[ 9] to 'char *[]' can u help me....?[/QUOTE] Start your own thread for your problems | |
Re: Dude there are many mistakes in your program [QUOTE=bobyx;1209900]Hi.I write a program in C for my microcontroller(PIC 18F452) but faced to a problem that related only to C language and that is; as you can see in my Main program and the two Functions I want to pass an array … | |
Re: If you want to pass the shift information you want to make use of the object of the class ProductionWorker. You are trying to pass shift information in the object of class Employee | |
Re: Your scanf on line 33 ..you have made a tiny mistake ... Is this how you take an integer as input ? | |
Re: I dont think so ... Each file will get its own copy of the variables defined in the header file | |
Hello people I have a small doubt in operator overloading I am trying to overload the assignment operator. Here is my code for that [CODE] class rational { int x; int y; public: //All the constructos rational operator= (rational num) { // Why do we need to return a reference … | |
Re: If you want to do many things at the same time ... I would suggest you get a grip on Multi threading as well ... Might be useful | |
Re: To access the values of an array using a pointer is quite easy [CODE] int arr[]={1,2,3,4}; int* p= arr; int i=0; for(i=0;i<4;i++) printf("%d %d\n",*(p+i), p[i]); // To ways to do the same thing [/CODE] When p[i] is actually a short form for *(p+i). Now you can use this example in … | |
Re: Is this code all there is or is there more to it |
The End.