Posts
 
Reputation
Joined
Last Seen
Ranked #557
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
91% Quality Score
Upvotes Received
14
Posts with Upvotes
11
Upvoting Members
8
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
5 Commented Posts
Member Avatar for logicslab

Why would you want to use graphics.h anyway? It was written for dos, and almost no one runs dos now.

Member Avatar for James_163
2
27K
Member Avatar for chrjs

I am doing this assignment for my computer science course, and I have to write a function that determines if 'x' can fit into an n-bit, two's complement integer. I am not allowed to use any control statements or operators other than the [ICODE]! ~ & ^ | + << …

Member Avatar for mbelenske
0
2K
Member Avatar for Josue198s

Indentation is pretty important too, especially when you have a problem with looping [CODE]#include<stdio.h> int main() { int pcheck = 1,i; int k = 1000 for(i = 2;i < k;i++) { if((k % i) == 0) { pcheck = 0; break; } } if(pcheck) { printf("%d is a prime .\n",k); …

Member Avatar for rajii93
0
223
Member Avatar for sillyboy
Member Avatar for cijeh90

You need to somehow determine what the input file is like through arguments or cin, and then write a loop around the calculations that reads the data from the file until the sentinel value is reached. It looks to me like you just posted the code from that assignment #3 …

Member Avatar for azwan91
0
310
Member Avatar for digitalhead

Like WaltP said, you should have the command write to a file and then read from that file. You should probably use the "system" function in stdlib.h. You don't have to "embed" a shell inside of your C program. Also, the good thing about the find command is it lists …

Member Avatar for ashok.bandari88
0
219
Member Avatar for kutuup

Are the [ICODE]ALLEGRO_BITMAP, ALLEGRO_EVENT, ALLEGRO_EVENT_QUEUE[/ICODE] identifiers macros, or just normal types?

Member Avatar for kutuup
0
1K
Member Avatar for something_techy

Although Ancient Dragon's solution should work, the problem with your original code is probably with the byte order. Most modern computers have little endian byte orders meaning that the bytes are stored least significant to most significant, e.g. a 16-bit integer of 0x1234 would be stored as the 8-bit bytes …

Member Avatar for Narue
0
301
Member Avatar for Drakarus
Member Avatar for wildplace

[QUOTE=wildplace;1537133]yah..=D that works for me.. and a other question.. if my system is 32bit, i coulnt use 64bit registers?[/QUOTE] Then just replace "%%rax" with "%%eax" and "movq" with "movl"

Member Avatar for wildplace
0
119
Member Avatar for p.user01

[QUOTE=Narue;1540386]It's a gross generalization, but in my experience, if the publisher is out of India, it raises red flags; I have yet to see a decent beginner's book on programming come out of India. Can you learn from these books? Absolutely. Will you pick up an excessive number of bad …

Member Avatar for WaltP
0
307
Member Avatar for jithuvsjithu

If you don't have a question, then this should go under code snippets. Also, it would be best to stay away from non-portable deprecated libraries such as graphics.h and conio.h

Member Avatar for Soubhik
-1
179
Member Avatar for charchar88

[QUOTE=abhimanipal;1539761]Quick question do you know the relevance of the keyword extern ? I removed extern and the program compiled with just 1 warning[/QUOTE] The extern keyword means that the variable is defined outside of that source file. The warning you got probably came from using the variables that were declared …

Member Avatar for TrustyTony
0
369
Member Avatar for iklila

In 32-bit protected mode, interrupts are used as exception handlers, like what Athelas said. They are essentially handled exclusively by the operating system and the hardware. And in 32-bit pmode, you can't call an interrupt from your program (unless your program is the kernel or a driver.) In 16-bit real …

Member Avatar for Athelas
0
102
Member Avatar for reloadmvp

You never include <string> or <iostream> in your header file so the "string" class is undeclared (you should put "using namespace std;" in your header too). Also you are using names for your get, set, and variable declarations for your strings.

Member Avatar for reloadmvp
0
209
Member Avatar for c++lover

If your writing a program for windows XP, not DOS, then your target executable should really be a .EXE not a .COM

Member Avatar for chrjs
-1
174
Member Avatar for Labdabeta

Arrays work the same in 16-bit and 32-bit, you just have to allocate enough memory on the stack that you need. [CODE]; allocate space for an array of 10 bytes sub sp, 10 mov bx, sp ; bx is the pointer to the start of the array[/CODE]

Member Avatar for chrjs
0
102
Member Avatar for yongj

That is platform-dependent, what OS do you have? The easiest solution would probably just be to use the system() function with a console command that would do that for you, like "find" on *nix systems.

Member Avatar for Ancient Dragon
0
164
Member Avatar for axn

[QUOTE=WaltP;1535617]Where is [iCODE]strdup()[/iCODE] defined? How is it defined? It's not an ANSI function.[/QUOTE] strdup is part of the GNU C library which can be found basically every linux machine. It is a declared inside of string.h. It duplicates a string like strcpy, but uses malloc so it can be freed …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for anirudhruia

You never allocate any space for the char pointer [ICODE]arg[1][/ICODE]. You could either call a function like malloc and dynamicly allocate space for that c-string, or you could declare the c-string to the stack, like [ICODE]char arg1[100];[/ICODE].

Member Avatar for untio
0
132
Member Avatar for toferdagofer

In string constants enclosed in quotes, the backslash\ is used as an escape sequence so you can put in characters that you normally couldn't type into the string, like \" or ' so you have to use the escape sequence for the \ in the file name which is just …

Member Avatar for Moschops
0
152
Member Avatar for irinaki
Member Avatar for chrjs
0
162
Member Avatar for c++lover

In your for loop in the traverse function you have the condition [ICODE]list.next()<=list.length()[/ICODE], but list.next returns a bool value, meaning that it is either 1 or 0. And since the length never changes inside that loop, that loop is infinite unless you enter the loop with the list having a …

Member Avatar for chrjs
0
111
Member Avatar for cufisa

[QUOTE=Software guy;1484359][code] #include<stdio.h> int main() { int i,j,temp; printf("\nEnter the Number :"); scanf("%d",&temp); switch(temp) { case 1: for(i=0;i<5;i++) { for(j=0;j<=i;j++) { printf("*"); } printf("\n"); } break; case 2: for(i=5;i>0;i--) { for(j=0;j<=i;j++) { printf("*"); } printf("\n"); } break; case 3: for(i=5;i>0;i--) { for(j=0;j<=i;j++) { printf("*"); } printf("\n"); } break; case 4: …

Member Avatar for aamira_s
0
158
Member Avatar for Kirbyzdashiznit

In your scanf statements, you are dereferencing a pointer and then referencing that, which basically does nothing. You pass pointers into getDate, so you don't need to dereference of reference anything, you can just write it like [CODE]scanf("%c", vehic);[/CODE]

Member Avatar for chrjs
0
407
Member Avatar for denmarkstan

It probably doesn't have to do with the source code. I think it is because that the compiler/IDE you are using doesn't have write permissions for your target. Try running your compiler/IDE in administrator mode and then building the project again. If that doesn't work, you could try deleting the …

Member Avatar for chrjs
0
190
Member Avatar for tricket_7

I would recommend that you use an std::string instead of a char*. std::strings are safer than char*s and don't require functions like strcpy. So for example: [CODE]std::string highest_str; //you don't need the "std::" if you have "using namespace std;" in your code //...some code here... highest_str = "January"; //...some code …

Member Avatar for tricket_7
0
650
Member Avatar for flowerpixie

You also should be able to replace the "600" in Unseen Machine's example with a call to [ICODE]dbScreenHeight()[/ICODE] for readability and so that you don't have to change that in the case that the screen size changes, but you still should adjust that value to the rocket's size by subtracting …

Member Avatar for chrjs
0
266
Member Avatar for rjbrjb777

In your while statement on line 35 you are using a %s to get input for a float, I don't know what result this will produce from fscanf, but it is possible that the loop is never entered and that the calday is never called, and even if it is …

Member Avatar for rjbrjb777
0
160
Member Avatar for taumang

Wrong forum, this should be in Hardware & Software->Microsoft Windows->Windows Vista and Windows 7.

Member Avatar for benmar
0
99