- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 14
- Posts with Upvotes
- 14
- Upvoting Members
- 4
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
57 Posted Topics
Re: [QUOTE=Mr Gates]Ebil cscgal :twisted: Anyway, how would I do that so it deleted the file at closing?[/QUOTE] you can register a function that will be called when the program terminates with the atexit() function. this func could tehn call remove() on the file. | |
Re: write some code, and then ask us for help when u get stuck. read the sticky about homework. | |
Re: [url]http://www.linuxgazette.com/node/view/1644[/url] check that out. | |
Re: the definitive book to pick up would be charles petzolds "programming windows" | |
Re: it is faster to type but there's no difference in the code generated, test it and see for yourself. | |
Re: u are almost there. the scanf function returns teh number of correctly read variables. in your while loop, u are testing: [color=#000000][color=#007700] while (([/color][color=#0000bb]amt [/color][color=#007700]<= (float) [/color][color=#0000bb]100[/color][color=#007700]) && ([/color][color=#0000bb]correctItemsRead [/color][color=#007700]== [/color][color=#0000bb]1[/color][color=#007700])); but actually it should be: [/color][/color][color=#000000][color=#007700] while (([/color][color=#0000bb]amt [/color][color=#007700]<= (float) [/color][color=#0000bb]100[/color][color=#007700]) && ([/color][color=#0000bb]correctItemsRead [/color][color=#007700]!= [/color][color=#0000bb]1[/color][color=#007700])); when it returns 1, … | |
Re: agreed, it is always a good habit to get into. the only time u will see good programmers avoiding the practice is when writing kernel code - when every instruction counts, and then it is ur responsibility to be absolutely positive to double check that every variable is not used … | |
Re: forgot to check malloc() for error return, looks cool other than that :-D | |
Re: i'm not sure if this is the answer u want, b/c i dont fully understand what u mean by "log window", but if u run a program from DOS prompt like: ./program >outfile standard output is redirected to the file outfile. if u want to do that inside the program, … | |
Re: you need to learn a lot more to use graphics. most windows apps use the win32 API to display windows/pics/etc.. here is a tutorial bout it tho: [url]http://www.relisoft.com/win32/winnie.html[/url] | |
Re: in 99.99% of cases it is much better to learn to write code that your compiler can optimize well. ie, compiling and observering generated code, and trying to fix your C to generate the proper asm. asm resources: [url]http://cs.smith.edu/~thiebaut/ArtOfAssembly/artofasm.html[/url] [url]http://www.geocities.com/SiliconValley/Lab/1563/assembly.html[/url] in short, on IA-32, registers eax, ecx, edx are called … | |
Re: read in the number of hours from the user using cin. if the number is <= 3, then charge is 2 else if the (number of hours - 3) * .50 + 2 > 10, it is $10 else the answer is (number of hours - 3) * .50 + … | |
Re: [url]http://www.devenezia.com/downloads/round-robin/index.html[/url] google. | |
Re: your add_item method should traverse to the END of the list, and add the element there. the remove_item method should remove the first element in the list. | |
Re: [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__popen.2c_._wpopen.asp[/url] need to use _popen() to send commands down a pipe to format, ur method will not work. | |
Re: read in the toll file, read in the customer file. store the customer's data into a structure. if the customers balance is > 0 then print out the data. what is it that u dont know how to do? we dont do homework here. write some code, when u get … | |
Re: if u check on java.sun.com they have a tutorial for nearly everything could imagine. | |
Re: c++ is a subset of c, or maybe it's the otehr way round i 4got that crap, but anyhow, piont is, u can't. | |
Re: a test plan is designed to test the robustness of your program. if you are taking in any input from the user, you would want to try many values for those inputs. most importantly, u would want to try values that a "nice" user wouldn't give u. for example, would … | |
Re: yea, that's what apache does. what exactly are u trying to do here? | |
Re: if it returns void, then you can't use the return value b/c there isn't one! you are trying to "cout << Calc()" , that means print out the return value of function Calc(), but it has no return value since the return type is void. | |
Re: you're better off using the STL if you can, their algorithms are far superior to what most of us could write. | |
Re: u need extra parentheses around the = assignment [code] return ( (remainder = ( num1 > num2 ? num1 % num2 : num2 % num1) )==0 ? num1 : gcd2(remainder, num1)); [/code] | |
Re: most p2p networks are just a bunch of people sitting at their home PC's all running some software program that creates a "network" between them. usually when a user starts this program they will connect to some central server that sends them a list ofa ll the other users logged … | |
Re: the compiler is telling u waht is wrong. the manual page apparently has an incorrect prototype, b/c gcc is telling u that it is returning an integer. try loooking at the header file and seeing if it has any notes on the function, or u can always try casting the … | |
Re: post your code enclosed in the [ code ] [ /code ] tags so it is formatted: [code] see the spaces get preserved [/code] and post the section of code u need help on, not 19 pages of it. | |
| |
Re: if you call an exec() function from a thread, the entire process will be replaced by the program u call, not just the single thread of execution. exec'ing replaces the entire address space of a process with the application being executed. what u want to do is fork() off a … | |
Re: read the irc protocol for starters, or try packet sniffing a session of irc so u can see what goes on. | |
Re: if u read a lot of books they'll tell u most of what u need to know. | |
Re: use the & and << operators. remember that a character is just a sequence of bits. u cant test for each bit and output the result. [code] int main() { char x = 'a'; int y; // the value of 'a' in hex is 0x61, or 97 decimal // in … | |
Re: use the seek methods [url]http://www.cplusplus.com/ref/iostream/fstream/[/url] | |
Re: i was trying to learn about firmware a couple weeks ago b/c i wantd to hack my router. i found that most firmware is just plain ol C.. | |
Re: google for 'i/o ports tutorial C' | |
Re: 1) b/c C is a minimal, spartan like language 2) shift each bit out and test it: [code] unsigned int num = 0xdeadbeef; for(int x = 0; x < (sizeof(int) * 8); x++) if(num & (1 << x) ) printf("bit %d is on\n", x); [/code] 3)using the `stringification' operator in … | |
Re: uhhh.. u obviously didnt write that code. massPounds is a variable, this is where u store the user's input. cin gets input from the user, and stores it in the massPounds variable. so, u wouldnt want to use the variable until after you have taken it in from the user. | |
Re: linux: sleep() or usleep() #include <unistd.h> windows: Sleep() #include <time.h> | |
Re: you need to make sure u terminate everything u send with "\r\n", or telnet server wont recognize it. and u'll need to login properly, i'd check out part of the telnet RFC, or try and google for a quick telnet tutorial; as well as sniffing your own traffic on a … | |
Re: i have no idea what u r talkin about.. care to elaborate? 'hooked'? | |
Re: yes it is very solvable. unresolved references mean that you either, dont have the correct libs, or those libs are not being included properly by the compiler. u need to first figure out where that function is supposed to be defined(what lib file), and then see if u have that … | |
| |
Re: can u please post using code tags. [code] #include <iostream.h> #include <conio.h> const int MAX_ITEMS = 5; typedef int InventoryArray[MAX_ITEMS]; void DisplayOpeningMessage(); void DisplayEndMessage(); void OutputInventory(const InventoryArray items); // const used to protect the array from being changed void InputInventory(InventoryArray items); void ProcessChoices(); void OutputOneInventoryAmount(int amount, int itemCode); void ChangeOneInventoryAmount(InventoryArray … | |
Re: visual studio usually ships 'neutered', meaning you can't build standalone apps to distribute. depending on what version u have, this is may or may not be true. usually the expensive, ie. Professional Version, lets u build standalone apps. this is done by going to Build->Configurations and selecting Release mode instead … | |
Re: [url]http://www.icce.rug.nl/documents/cplusplus/[/url] and one of the best books written on C++ is available free, here: [url]http://www.camtp.uni-mb.si/books/Thinking-in-C++/Contents.html[/url] | |
Re: ehh, a pointer isn't gonna do much for ya d00d. whatever calls u make are going to eventually map to a device driver, so here is a place to start: [url]http://www-2.cs.cmu.edu/~iwan/1394/[/url] | |
Re: i wrote an ftp library, found here: [url]www.1nfamus.netfirms.com[/url] look halfway down page or so, feel free to modify/use it as u plz. |
The End.