2,867 Posted Topics
Re: Why are you putting so much effort into shoehorning your code onto a dinosaur of a compiler? Yea, you may have "fixed" this issue but that's only one of hundreds of problems you'll encounter with a compiler that should have stopped being used 10 years ago. Let dead compilers lie … | |
Re: Now that you've posted your code, is there a question you'd like to ask? | |
Re: Make a structure for your objects: [code]struct Object3D { int ***facets; float ***vertices; int *nFacets; int *nVertices; int numObjects; ... /* add all variables specific to your object here */ } [/code] Then, modify countObjects, loadShape and whatever other functions you need to take a [icode]struct Object3D*[/icode] as one of … | |
Re: The only problem with explaining the usage of noparse tags is that it becomes somewhat cumbersome to explain the exact usage of the noparse tags themselves. For example, consider the following: [quote]Use noparse tags like this: [noparse][noparse] [code] code goes here [/code] [/noparse][/noparse][/quote] The above example was created by using … | |
Re: Boot off your Windows install disk into the recovery console, then run [URL="http://pcsupport.about.com/od/termsf/p/fixmbr.htm"]fixmbr[/URL]. | |
Re: Use [URL="http://opengroup.org/onlinepubs/007908775/xsh/popen.html"]pipes[/URL]. Even better, use the POSIX libraries to create your own ls() function: [url]http://opengroup.org/onlinepubs/007908799/xsh/opendir.html[/url] [url]http://opengroup.org/onlinepubs/007908775/xsh/readdir.html[/url] | |
Re: Well... does your Mac detect it? Try using Disk Utility to check if your Mac recognizes the second hard drive. [LIST=1] [*]Plug your external hard drive into your PowerBook. [*]Disk Utility is in the Utilities folder, which is located within your Applications folder. Start it up. [*]Look in the left … | |
Re: HFS+ is a filesystem that's designed so that it shouldn't need to defragged. However, if you really need it (normal usage won't need it), iDefrag is available, although it's not free. And of course, the best way to clean up a filesystem is to wipe it and start from scratch. … | |
Re: You can either compress them with a non-lossy method (for example, putting all your photos into a zip archive), or a lossy method (scaling them so the pictures themselves are actually smaller, or saving them at a lower quality). | |
Re: You most likely haven't installed the Microsoft Core Fonts. | |
Re: [url]http://www.parashift.com/c++-faq-lite/pointers-to-members.html#faq-33.5[/url] | |
Re: >For that reason, the window shows once per visit to DaniWeb. Determining a 'visit' upon the referring URL is incredibly annoying. Not everyone enables referring URLs, and people often go directly to certain pages without clicking a link (bookmarks, for example), or edit URLs before they go to them (eg. … | |
Re: I'm primarily [URL="http://redwing.hutman.net/~mreed/warriorshtm/archivist.htm"]archivist[/URL]. I do however enjoy being a [URL="http://redwing.hutman.net/~mreed/warriorshtm/jerk.htm"]jerk[/URL], and a [URL="http://redwing.hutman.net/~mreed/warriorshtm/nanny.htm"]nanny[/URL]. >Gah, I was hoping for a quiz to do it for me; According to [url]http://www.quizilla.com/quizzes/1000935/which-flame-warrior-are-you[/url] I'm a Kung-Fu master, although I've engaged in far too many battles and made enough blunders that I don't qualify for that … | |
Re: The real reason you're having problems with your code is you're trying to modify a string literal: >printf("ID: %d\n", getCommandId("move")); You never allocated space for "move", so who knows what strtok() and your strToUpper() function are trying to do with your computer's memory. | |
| |
Re: C(n,r) can be calculated as follows: [tex]C(n,r) = \frac{n!}{(n-r)!r!}[/tex] Which means your horizontal component would be 'r', and your vertical component 'n'. | |
Re: printf takes a formatting string as its first parameter. You probably meant: [code]printf( "%d\n", bytes_received );[/code] | |
Re: jepthah is right, there's far too much proprietary code for anyone here to help you. Not to mention fflush(stdin), and fixing your program so you don't require that could take quite some time. I will point out a fairly simple thing you can do to improve your program however, change … | |
Re: My guess would be a framebuffer issue. Are you using one right now (eg. is your console text smaller than, say, the text from your BIOS), and if so, what are the settings for it? You can check these in your bootloader, usually /boot/grub/menu.lst, or /etc/lilo.conf if you're using lilo. | |
Re: That's pretty simple. Include the <ctime> header, then use the function [URL="http://www.cplusplus.com/reference/clibrary/ctime/localtime/"]localtime[/URL]. That does the converting process from time_t to a tm structure, and from there you can extract the data into your objects. If you need to go the other way (tm to time_t), you can use the [URL="http://www.cplusplus.com/reference/clibrary/ctime/mktime/"]mktime[/URL] … | |
Re: >as for the EOF macro, it's not standardized. Actually it is. >It can have different values depending on compiler. That's why it's a macro. If fgetc encounters the end of the file, it will return the value represented by EOF. >It can also be a catchall for various error codes. … | |
Re: How about [code]void analyze( struct Crypt key[] ) { ... }[/code] Although not required, you should pass the size of the array, too: [code]void analyze ( struct Crypt key[], int size )[/code] This way the function works with different array sizes. | |
Re: Make a function that takes 2 integers as parameters, and returns an integer. You can print the result in hexadecimal form with the std::hex mode: [code] num = ANDoperation(0x0011, 0x0101); std::cout << "0x" << std::hex << num;[/code] | |
Re: We don't even have a code tag checker (which would be relatively straightforward to implement). What makes you think we'll invent a literacy checker any time soon? | |
Re: >Prototypes don't go inside other functions. Wrong. Prototypes don't [I]usually[/I] go inside other functions. | |
Re: >With certification you will stand out in the crowd of other graduates... I doubt it. | |
Re: >however do you think would work if I did something crazy like >char string [] = getstring(15); No, you can't initialize an array with a memory address. That's what pointers are for. | |
Re: Try [icode]java HelloWorld[/icode]. The .class file is the actual bytecode which java executes, but the java program requires you give the filename without the extension. | |
![]() | Re: It sounds like you aren't dealing with all levels of permissions. In UNIX operating systems, there are three levels: - owner permissions - group permissions - everyone permissions My guess is that you only adjusted 'owner' permissions, which doesn't mean squat if you left full permissions for everyone else (which … |
Re: >sure you can write a program with conio.h, but it will be broken on most every >non-microsoft systems. And you can write a termios.h solution that will be broken on every non-POSIX system. What's your point? You can't portably change the shell's input mode without the use of a third … | |
Re: Use the -R flag for chmod to make the permissions recursive. | |
Re: >For some reason Mod's refuse to use [noparse][quote][/quote][/noparse] tags I use them less frequently than other people because [quote] tags are terribly bulky for quoting 1-2 lines. Plus, consider that a lot of us here have a history of using newsgroups and mailing lists, where '>' is the only accepted … | |
Re: So the fact that it wasn't even installable without hacking the .msi doesn't hint that maybe it's not supported on Windows 7 yet? Windows 7 is still a beta, don't expect too much from it. | |
Re: >Technically speaking, I initialize and reinitiaize str pointer with every word I read from file. You clearly don't understand how memory works in C. Either you use static memory, in which case the compiler takes care of allocation and deallocation, or [B]you[/B] have to take care of it yourself (dynamic … | |
Re: [url]http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18[/url] | |
Re: [quote][code]int number; inFile >> number; while(!inFile.eof()) { inFile >> number; [/code][/quote] You're overwriting the first number in the file. You haven't counted whether the first line in the file is the number that the user entered. That's why your program only reported 3 occurrences of 64. Your second problem is … | |
Re: There's much easier ways to accomplish what you're trying to do. Try using python's built-in string module. [code] if type(x) == str: if x.isupper(): # character is uppercase elif x.islower(): # character is lowercase else: # this is not a string[/code] | |
Re: This doesn't have anything to do with C, but your shell. For example: [code]$ some_program < input_file[/code] When some_program reads from stdin, it will be reading the contents of input_file. | |
Re: I have no idea what you mean by 'classes' (are you really programming in C?), but in general you should put structures and function prototypes in your headers, then [ICODE]#include[/ICODE] them into whatever headers or source files you need them in. | |
Re: You've got smart quotes [icode]“[/icode] instead of straight quotes [icode]"[/icode]. Did you write that code in a word processor? | |
Re: Try converting the string to a long int first with strtol(): [icode]val = strtol( argv[1], NULL, 10 );[/icode] It's also a good idea to set [icode]errno=0[/icode] before calling the function; you can then check it afterward for errors (return value isn't reliable since 0 can be a valid result). | |
Re: [url]http://www.daniweb.com/forums/thread184645.html[/url] | |
Re: >since I'm zeroing 2 -> 8 bytes and rest I'm not zeroing, why my buffer is all zero? It's not. It only zeroes out 8 bytes at a time. You probably assumed the entire string was zeroed when you tried to print it, since a 0 (or null character) indicates … | |
Re: I second Ezzaral for the forum tools menu. It's more convenient than navigating back to the forum index. | |
Re: What are you trying to do? Variable names are largely irrelevant; they're just a means of accessing memory in your system. Learn about pointers and you'll understand how this works. | |
Re: Well, let's say you've declared a 2D matrix as the following: [icode]int matrix[n][n];[/icode] How would you write numbers around the border? [code] 1 2 3 4 5 16 6 15 7 14 8 13 12 11 10 9 [/code] Now think of a circular matrix as a set of these … |
The End.