5,676 Posted Topics
Re: Becuse of this: [URL="http://c-faq.com/expr/evalorder2.html"]http://c-faq.com/expr/evalorder2.html[/URL] | |
Re: [quote=Shital Parab]I am novice of c++. How to set co-ordinates of console using c++? e.g. what to do if i wanna print pyramid of astericks at the center of the screen. should i use gotoxy(x,y) function to go to the center of the console?[/quote] No. You should print the correct … | |
Re: What are you guys taking about? The original request is: [quote=sgriffiths]how would i go about converting a string value to HEX ie char name[10]="STEPHEN"; Convert name to HEX[/quote] What does this mean? 1) "STEPHEN" is not a number so it can't be converted to Hex or 2) "STEPHEN" is a … | |
Re: [quote=Eddy Dean]A better idea is to invest in Microsoft Visual Studio, so you can use the software everyone uses and is familiar with. It also contains other programs, for example visual basic which is a pretty fun language.[/quote] I disagree. First, everyone doesn't use it. Second, DevC at least follows … | |
Re: I agree. Go with C++. C# is for a specific arena so you would be better off IMO learning a general tool. C is easier, but C++ is becoming more universal, and will be easier to learn if you don't already know C (again IMO). | |
Re: Well, you have a hard uninteruptible loop of 39,321,600 iterations. How long is this going to run do you think? And once it starts, it's going to run until completion. Remember, you are in an interrupt. The way I remember it, an interupt will not let the normal programs run … | |
Re: I'd prefer: [code] #include <stdio.h> int main() { unsigned char a[100]; // unsigned to make all values positive int len, i; printf("Enter the string"); fgets(a, 100, stdin); // safer than scanf() i = 0; while (a[i]) // use 'end' of a string as your guide { if ((a[i] >= 'a') … | |
Re: Another option is to read a good sized chunk of the file (5K, 1M, 10M) and operate on the data while it's in memory. When you have 10% of the chunk left unprocessed, move it to the beginning of the buffer and read the next chunk. Reading a buffer at … | |
Re: I'm going to assume [B]csgal[/B]'s tutorials helped on the programming. One thing you will eventually need to do (like right now) is start formatting your code. Indent after ever { and unindent when you get to every }. Also every [I]if[/I] statement is wrong. = is the assignment operator. == … | |
Re: [quote=squirrel]And how does the program read the value n2?[/quote] The best way to answer these type of questions is to just try them: [code] int main(int argc, char *argv[]) { int param; printf("argc = %d \n", argc); for (param=0; param < argc; param++) { printf("%2d) %s \n", param, argv[param]); } … | |
Re: [quote=brale]About void main ():[/quote] In addition, check out [URL="http://users.aber.ac.uk/auj/voidmain.shtml"]this[/URL] | |
Re: In my TurboC setup I have a TURBOC.CFG config file in the directory with the executables. It contains [code] -Ic:\lang\TC\INCLUDE;c:\lang -Lc:\lang\TC\LIB;c:\lang -v [/code] [B]-I[/B] finds any headers in either directory listed. [B] -L[/B] same for libraries. [B] -v[/B] to add debug code to the compile. I have the compiler in … | |
Re: [quote=BronxBoriqua]I want to learn C+ but i want to start with a simple compiler. I have access to Borland C++ and Visual studios.net but they are way to overwhelming. Can some body give me names of decent simple programs that I can learn with.[/quote] All the compilers are going to … | |
Re: Since all you are reading is a character, use [inlinecode]getchar()[/inlinecode]. But remember that you did hit the ENTER key too. You therefore have to clear the buffer. So when you read a character, use something like [code] whatever = getchar(); // at least one character left in the input stream … | |
Re: >i always use `system("pause");` to hold the black srceen open. but it has no effect. u can reply to this if you have any other suggestion but i wont be able to answer for another hour or so...but pls any help will be greatly appreciated! Why use `system("pause");` to call … | |
Re: [quote=jaden403]Is there a better way to go about this than what I am trying here?[/quote] Yes. Read in all the words to ignore into an array. Then read in a word at a time from text.txt and see if the word is in the ignore list. If the word is … | |
Re: First thing you need to do is clean up your formatting so you (and we) can see your program flow. After every { indent 4 spaces. When you get to the } unindent. Look up the syntax for this statement: [code] if ((multand<=32767) && (mult<=32767)); [/code] If this [I]and [/I]that … | |
Re: [quote=AhmedHan]Recently I installed Visual Studio 2005 .NET on my computer. I wrote a Win32 program. But my program doesn't run on PCs that doesn't have Framework 2 installed on.[/quote] Gee, why does it not surprise me that you can no longer just build a program and run it anymore? | |
Re: [quote=LieAfterLie]Thanks. I didnt think to use a matrix like that, so that i dont have to reference every solution individually, i can reference by number (which is sortof what i was looking for to begin with). I wouldn't need getSolution as a function, would I? Since it would only be … | |
Re: [quote=jazzz] in the code i see that it sorts accodring to "code", how can i modify the program so that it sorts even according to "subcode" and "brandcode"; i.e., code as primary key, subcode as secondary key and brandcode as third key; here, each code has a subcode and each … | |
Re: Ahhh, fergitit.... ;) | |
Re: Try [code]#include <string>[/code] string.h is not meant for 'C++strings', it is for char* or 'C-strings' | |
Re: Recommendation: Unless you [i]must[/i] leave floats and doubles in the program, settle on one or the other. Doubles would be best. | |
Re: [quote=CStallion]So I try "\-126" and get a compile error. Any other ideas?[/quote] -126 is 82 hex -- try \x82 | |
Re: If you wish, your program can assume that if there was nothing on the command line, redirection is being used. In that case, instead of using the [I]fopen()[/I], simply assign [I]stdin[/I] to your stream: [code] FILE *stream; if (argc < 2) { stream = stdin; } else { stream = … |
The End.