1,494 Posted Topics
Re: Well try including the header cctype and using the function [code] int isdigit(int c) [/code] | |
Re: If you want to isntall Code::Blocks for Windows go here [url]http://sourceforge.net/projects/codeblocks/files/Binaries/10.05/Windows/codeblocks-10.05mingw-setup.exe/download[/url] It should start downloading Code::Blocks with the GNU gcc compiler...Note I would uninstall your previous Code::Blocks first. | |
Re: If your trying to pass a function pointer, use typedef and it'll simplify your code. [code] typedef void (*myfunc)(); void thefunc(myfunc p) { //... } [/code] | |
Re: You'll have to investigate the stream character by character using isdigit(). | |
Re: Take a read here [url]http://www.newty.de/fpt/fpt.html#r_value[/url] Especially the section - 2.7 How to Return a Function Pointer ? | |
Re: Maybe you could isolate one function and that function call that produces the zeros and post that...Posting ~ three hundred lines of code and saying it doesn't work - fix it please - is infuriating. | |
Re: Take a look at your braces in your if statement. Try this [code] bool checkNumber(int arr[], int value) { for(int i=0; (i < 10); i++) { std::cout << arr[i] << std::endl; if(value == arr[i]) { return true; } } return false; } [/code] | |
Re: Hint. Don't use gets its a dangerous function. Instead use fgets(). Don't use magic numbers like 100 use a macro like [code] #define ARR_SIZE 100 [/code] Also [code] int *k; [/code] Should be [code] char *k; [/code] | |
Re: I would read the contents of this link [url]http://www.cplusplus.com/reference/string/string/[/url] I would really pay attention when you get to the string's method find. | |
Re: If your an experienced programmer(Java/C++) then C# 4.0 in a Nutshell by Joseph Albahari, Ben Albahari is a good read. | |
Re: What part of the program are you having problems with? I ask because a C program is mostly a C++ program. | |
Re: Try passing the values as references. | |
Re: Wow another on posting a homework assignment...Please read the forum rules about posting homework assignments. | |
| |
Re: Number one, The code doesn't run in a compiler. The code is compiled by the compiler so that it can run within an operating system environment. How many threads? Just one, the main thread. | |
Re: Are posting your homework assignment? | |
Re: Try the escape sequence \" e.g. [code] std::cout << "this is a quote \"" << std::endl; [/code] | |
Re: If the error is in your test.h file, maybe you should post it. Oh you did. Why do you have the main function in your header file? My mistake, I didn't realize you grouped the header and object file together. | |
Re: You can use your first example [code] #define NINE 0x39 [/code] | |
Re: Why are you using a reference to a pointer in your equals operator? | |
Re: Your for statement is set up wrong. [code] for(int x=1, y=0; y < 5, x < 15; x++, y++) [/code] Are you sure you want your condition part of a comma operator? Try running this code. [code] #include <iostream> int main() { for (int i = 0, j = 0; … | |
Re: If the memory manager can fulfill the malloc request it will return a memory pointer to the allocated memory...if it fails it returns NULL. If malloc returns a pointer other than NULL then you have your requested memory. | |
Re: This link may give you some preliminary information. [url]http://en.wikipedia.org/wiki/64-bit[/url] | |
Re: The problem is line 13 [code] _matrix.GetM(i, k) [/code] The vector container has no method called GetM(). | |
Re: Wow what compiler are you using? I can't believe this wasn't flagged. [code] string input(string a[], int &cnt) { for (int i = 0; !infile.eof(); i++) { getline(infile, a[i]); cnt = i; } } string copy(string a[], string b[], int cnt) { for (int i = 0; i < cnt; … | |
Re: You forgot. The main function should return an int. | |
Re: You should be able to or your conditions together. | |
Re: You could check the sticky in this section 'Starting C'. I just noticed it today. | |
Re: You posted your homework assignment? Wow, read the forum rules. | |
Re: Sure, can you tell use what the problem is? | |
Re: Maybe if you tried [code] if ((scode == "r") || (scode == "R")) [/code] | |
Re: Pointers that are not set to NULL or a valid memory address are said to be wild pointers, they may be pointing at anything so are very dangerous. The general rule is - Set a pointer to a valid memory address or set it to NULL...Always keep your pointers in … | |
Re: I know the GNU g++ complier has limited support with the -std=gnu++0x switch. | |
Re: All I can tell you is, get a good book on the subject. Here's a website, check some of the titles. [url]http://www.cs.purdue.edu/homes/dec/netbooks.html[/url] especially - Internetworking With TCP/IP Volume III: Client-Server Programming and Applications, Linux/POSIX Socket Version (with D. Stevens) | |
Re: And array is just a contiguous block of memory. Its doesn't support the division operator. | |
Re: It would help if you indicated which function your having problems with. | |
Re: I would investigate the do-while loop [url]http://msdn.microsoft.com/en-us/library/b0kk5few.aspx[/url] | |
Re: Your using a string format specifier %s for a character %c. Line 12 and 14. | |
Re: How and what are you calling Initialize (List *L) with. Note: You have this [code] L->items[i].name[MAXNAMESIZE - 1] = '\0'; [/code] Shouldn't it be [code] L->items[i].name[strlen(initialize)] = '\0'; [/code] ...After checking the docs I found strncpy pads the destination with '\0' so my point is null void. | |
Re: Your not passing the rent array to calculateRental...Also the first array element starts at zero not 1. | |
Re: I can't believe you compiler didn't warn you about this line.. [code] char test = "I like you"; [/code] Is this what your trying to do? [code] #include <stdio.h> #define ARR_SIZE 3 struct mys { char * my_arr[ARR_SIZE]; }; int main() { size_t i = 0; struct mys thes; char … | |
Re: I would check what you calling the function name in your asm file. Your calling it _addus in the asm file and calling it addus in your main executable. The linker won't be able to resolve the names if they don't match. | |
Re: How are you calling - void populate_bricks(sprites &game_data)? | |
Re: [QUOTE=Zssffssz;1654862] PS How would I setup virtual memory in linux? Muffins[/QUOTE] Your in luck, Linux already comes with virtual memory set up. | |
Re: Sounds like your trying to inject a piece of code somewhere. I don't think the forum encourages hacking practices. | |
Re: It means the function returns a integer reference for a return value. In your example prototype the function probably returns a reference to either a or b. | |
Re: Try running this code [code] #include <stdio.h> int main() { char aChar; printf("Please enter a character: "); scanf("%c",&aChar); while (aChar!='x') { printf("The Letter is %c or the integer is->%d\n", aChar, aChar); printf("Please Enter another character: "); scanf("%c", &aChar); } return 0; } [/code] Can you figure out what's going on? … | |
Re: Line 12. Why are you doing this [code] cin >> calc >> end; [/code] Why >> end; Is this what your trying to accomplish? [code] #include <iostream> #include <string> #include <cstdlib> using namespace std; int main () { string calc; cin >> calc; if(calc == "calc") { system("calc"); } else … | |
Re: Class C is derived from class A, so creating an object of type C will automatically create an internal object of A. Object of type C contains an object of type A |
The End.