- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 43
- Posts with Upvotes
- 38
- Upvoting Members
- 26
- Downvotes Received
- 9
- Posts with Downvotes
- 9
- Downvoting Members
- 8
- Interests
- Dream to fly light weight plane someday. Love adventure, video games.
Re: 1> 28 posts and still no code tag 2> Try to practice [B]int main(){}[/B] not just [B]main() or void main()[/B] 3> Post the exact error that u are getting. The code seems to be ok I think. | |
Re: In line# 41 push(root); Are you trying to push root. You should have done: push(temp); In line#50 void free(void *ptr); What you are trying to do here. Are you trying to free the memory or you want to redefine the function free() ? Better read about free(). Also, review your … | |
Re: use while(1) loop and inside the loop read one character at a time. Break from the loop on getting something other that 0-9. Handle the space explicitly. If the numbers are multi-digit numbers you will have to use temp buffer to store the number till u get a space. | |
Re: 1- Most importantly, what u are doing here is not proper quick sort. Read about it. 2- I don't understand why you have sent the array as "*v[]". Why do you think u need that. Why not just "v[]". 3- Putting function prototype inside another function. Not a great way … | |
Re: line#14: You have never done a "new Dll11Node()" for "iterhere->_fore" and trying to access "iterhere->_fore->_back". This is an obvious segfault. Use [B]gdb[/B] to debug your code if you are working on Unix/Linux. Its not that tough to catch a segfault. | |
Re: Use CODE tag and PROPER indentation. Explain exactly what problem you are facing. | |
Re: one way is: [CODE] const char* foo = "\n1\n2\n3\n4" [/CODE] another is [CODE] char* foo[] = {"1", "2", "3"} int count = 3; for(i=0;i<3;i++) printf("\n%s", foo[i]); [/CODE] | |
Re: you can use [CODE]scanf("%[^\n]",...);[/CODE] as well to scan a whole line. | |
Re: [CODE] #include<iostream> using namespace std; int main() { int *matrix; int dimension; /*read dimension first and initialise "dimension" and then allocate apropriate memory to "matrix" and then read the matrix into this array. This can also be done inside a function which will make your code more usable*/ /*process the … | |
Re: First you must know how to retrieve the pixel data of the image. (Please google about that, I never tried it in C/C++, but its easy to get the same in Java which I have done) Then you have to know how to rotate an image(pixel-wise) [URL="http://homepages.inf.ed.ac.uk/rbf/HIPR2/rotate.htm"]http://homepages.inf.ed.ac.uk/rbf/HIPR2/rotate.htm[/URL] And then you … | |
Re: add [CODE]#include"savingsAccount.h"[/CODE] in the file "customer.h" | |
Re: read the information using scanf/cin and then create the command using them. | |
Re: [CODE]typedef ListNode *ListNodePtr;[/CODE] means you are making an alias for "ListNode*" as "ListNodePtr". So when you declare avariable of type "ListNodePtr" it will mean you are declaring a variable of type "ListNode*". [CODE]ListNodePtr *sPtr; ListNodePtr startPtr;[/CODE] You will get the difference once you replace the alias name with the original … | |
Re: you are not resetting the stringbuffer to ""(empty string) after every iterations which is the reason why it is keeping the previous values. Reset the stringbuf at the end of every iterations then only you will get the expected outputs. | |
Re: line# 15: This is not the way you invoke a function. You should first know how to do that. Please read more about functions. Some more feedbacks: line# 22 and 26: How do you handle the loop if the number of rectangle is variable. Better have another argument in the … | |
Re: [QUOTE=benjybob;1508912] 1>c:\users\ben\documents\university work\year 2\c++\code\myc++\spritelab\asteroidsgame.cpp(17): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\ben\documents\university work\year 2\c++\code\myc++\spritelab\asteroidsgame.cpp(17): error C2365: 'srand' : redefinition; previous definition was 'function' 1> c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h(511) : see declaration of 'srand' [/QUOTE] Error #1: This is coming because C++ … | |
Re: Its in C itself. It is compiled and object is created which is archived in library. | |
Re: [CODE]mylinkedlist list_arr[20];[/CODE] where "mylinkedlist" is the linked list class. | |
| |
Re: [URL="http://www.google.co.in/search?hl=en&client=firefox-a&hs=6Ip&rls=org.mozilla:en-US:official&&sa=X&ei=3GF_TaIEjsq0BsCLhfkG&ved=0CG4QvwUoAQ&q=learn+guitar+strumming+patterns&spell=1#hl=en&pq=graphics.h%20in%20turbo%20c&xhr=t&q=graphics%20in%20C&cp=11&pf=p&sclient=psy&client=firefox-a&rls=org.mozilla:en-US%3Aofficial&aq=0&aqi=&aql=&oq=graphics+in&pbx=1&fp=116bc879be8b8161"]Google "graphics in C"[/URL] | |
Re: If you are talking about evaluating an expression, here is the link [URL="http://scriptasylum.com/tutorials/infix_postfix/algorithms/postfix-evaluation/index.htm"]http://scriptasylum.com/tutorials/infix_postfix/algorithms/postfix-evaluation/index.htm[/URL] | |
Re: Adding to that....... You can overload the operators ==, < and > for the class. | |
Re: In the recvfrom() function, use "MSG_DONTWAIT" flag in the 4th argument(which is the flag) and see whether it solves your problem. By default, the method will wait until it gets a message from the mentioned address, and your program will proceed only after that. Read the manual for recvfrom() [URL="http://man-wiki.net/index.php/2:recvfrom"]http://man-wiki.net/index.php/2:recvfrom[/URL] … | |
Re: Why on earth do you need a second array for reversing an array...!!! Below is a better approach to do it: [CODE] int i,j; for(i=0, j=arr_len-1;i<j;i++, j--)/*arr_len is the len of array*/ { /* swap arr[i], arr[j] */ } [/CODE] | |
Re: Please use CODE tags. Explain your problem clearly. Your class should be defined properly, e.g. [CODE] class spiral_matrix{ int N; int matrix_data[][]; public sparse_matrix(){ /*Constructor*/ } public init_matrix(){ /*initialize your matrix here*/ } public static void main(String argv[]){ /*...........*/ } /* other member methods*/ } [/CODE] | |
Re: IMP: Use Code tags. StringTokenizer [URL="http://www.java-samples.com/showtutorial.php?tutorialid=236"]http://www.java-samples.com/showtutorial.php?tutorialid=236[/URL] In the below code segment [CODE] if (p > 9) System.out.print(" " + p); else System.out.print(" " + p); [/CODE] What is that you are trying to achieve. (What are you doing different for the else part) | |
Re: any data type that you can think of. User defined types, char, unsigned, etc., anything..... | |
Re: [QUOTE=shinsengumi;1492086]Hi everyone! Is there a way/command in C to find a string that is contained in a longer string? [/QUOTE] strstr() is the answer to this problem of yours. [QUOTE=shinsengumi;1492086] I'm currently developing a C program in Windows that sends requests to a machine and gets its response through socket … | |
Re: before solving your problem lets look at the following code snippet [CODE] int x=4; int y=8; float z=x/y; cout<<z; [/CODE] Can you try this code and see what output you get. You might be expecting the output to be: 0.5 right ? But have a second look at the code. … | |
Re: example: file1.h [CODE] #ifndef FILE1_H #define FILE1_H int fun(); #endif [/CODE] file1.c [CODE] #inlclude"file1.h" int fun() { printf("in fnuction"); } [/CODE] file2.c [CODE] #include"file1.h" int main() { fun(); return 0; } [/CODE] If you are using some IDE, you can directly build the project because it will do the linking … |