5,676 Posted Topics

Member Avatar for nwiner

Becuse of this: [URL="http://c-faq.com/expr/evalorder2.html"]http://c-faq.com/expr/evalorder2.html[/URL]

Member Avatar for nwiner
0
108
Member Avatar for Shital Parab

[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 …

Member Avatar for WaltP
0
87
Member Avatar for sgriffiths

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 …

Member Avatar for Dave Sinkula
0
2K
Member Avatar for trevs234

[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 …

Member Avatar for justobioma
0
206
Member Avatar for jamshid

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).

Member Avatar for jamshid
0
179
Member Avatar for viermus

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 …

Member Avatar for thandermax
0
136
Member Avatar for kraze_101

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') …

Member Avatar for ~s.o.s~
0
195
Member Avatar for winbatch

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 …

Member Avatar for Ancient Dragon
1
221
Member Avatar for kakeen

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. == …

Member Avatar for WaltP
0
138
Member Avatar for squirrel

[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]); } …

Member Avatar for squirrel
0
259
Member Avatar for server_crash

[quote=brale]About void main ():[/quote] In addition, check out [URL="http://users.aber.ac.uk/auj/voidmain.shtml"]this[/URL]

Member Avatar for WolfPack
0
850
Member Avatar for Mamata

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 …

Member Avatar for WaltP
0
153
Member Avatar for BronxBoriqua

[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 …

Member Avatar for jetru
0
147
Member Avatar for isaacmacdonald

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 …

Member Avatar for WaltP
0
107
Member Avatar for mikki2

>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 …

Member Avatar for mikki2
0
321
Member Avatar for jaden403

[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 …

Member Avatar for jetru
0
161
Member Avatar for ethompson

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 …

Member Avatar for WaltP
0
203
Member Avatar for mikki2
Member Avatar for AhmedHan

[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?

Member Avatar for WolfPack
0
150
Member Avatar for LieAfterLie

[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 …

Member Avatar for AhmedHan
0
435
Member Avatar for jazzz

[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 …

Member Avatar for WaltP
0
191
Member Avatar for sadronmeldir
Member Avatar for newgurl

Try [code]#include <string>[/code] string.h is not meant for 'C++strings', it is for char* or 'C-strings'

Member Avatar for WaltP
0
272
Member Avatar for newgurl

Recommendation: Unless you [i]must[/i] leave floats and doubles in the program, settle on one or the other. Doubles would be best.

Member Avatar for WaltP
0
3K
Member Avatar for CStallion

[quote=CStallion]So I try "\-126" and get a compile error. Any other ideas?[/quote] -126 is 82 hex -- try \x82

Member Avatar for Ancient Dragon
0
3K
Member Avatar for yuzhang

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 = …

Member Avatar for yuzhang
0
385

The End.