Forum: C Apr 21st, 2009 |
| Replies: 6 Views: 759 Not surprisingly, but your program is doing what you told it to:
// Wait here for the user to enter a message
gets (msg);
while (msg != "q")
{
/* Write out message. */
... |
Forum: C Mar 2nd, 2009 |
| Replies: 6 Views: 452 No the problem is with python...you can't run python code without having python installed (or using the large python dll that has all of the python stuff in it.) The python code expects that all to... |
Forum: C Jan 28th, 2009 |
| Replies: 5 Views: 544 I'm sorry, did you bother to read my post at all?
/* TAking input from user and storing it in ArrTemp array */
fgets(ArrTemp, ARR_TEMP_SIZE, stdin);
for(iLength=0; iLength<ARR_TEMP_SIZE;... |
Forum: C Jan 28th, 2009 |
| Replies: 5 Views: 544 problems in fnAddDepartment():
fgets(ArrTemp, ARR_TEMP_SIZE, stdin);
for(iLength=0; iLength<ARR_TEMP_SIZE; iLength++)
{
ArrTemp[iLength]=Dept_Name[iLength];
}
The... |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 697 I thought of a way to write your program without using the '||' operator would be to double the ifs and have 2 sections for each.
if (m == 3 && d >= 21)
printf("\nYour star is ARIES");
if... |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 697 Actually, that code tag message was intended as a reply for yabuki
But if you're not posting your code with code tags, feel free to use them :) |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 697 I don't think I can be much more blatant.
When you type:
int main() {
printf("Hello, World\n");
return 0;
} |
Forum: C Jan 25th, 2009 |
| Replies: 16 Views: 697 That's very pretty code, but it should have been posted using code tags.
When posting c code, please use c code tags
/* Your code here */
And logically, the if statements you have don't... |
Forum: C Jan 24th, 2009 |
| Replies: 16 Views: 697 AND and OR are 2 similar but different constructs.
month = 3 && month == 4
Is an impossibility, it will NEVER happen
month == 3 || month == 4
happens for months 3 and 4 |
Forum: C Jan 24th, 2009 |
| Replies: 16 Views: 697 Rephrasing one of your if statements into english:
if (d>=21 && d<=19 && m==3 && m==4)
That reads: If the day of the month is both more than or equal to 21 and also less than or equal to 19... |
Forum: C Jan 23rd, 2009 |
| Replies: 5 Views: 787 Putting code in headers is generally bad form....if you include that same header in more than one file in a compilation unit you get duplicate symbols.
The original layout of the files should have... |
Forum: C Jan 10th, 2009 |
| Replies: 2 Views: 367 So 'list' is an index into the virtual heap, and each entry in the virtual heap is a structure that has an elem (the value at that node) and a next (the index in the virtual heap for the entry with... |
Forum: C Jan 7th, 2009 |
| Replies: 15 Views: 991 You will have to declare an array of characters to input into, you can't input directly into the enum.
The % format for an array of characters is %s
Then you will have to compare what they... |
Forum: C Jan 7th, 2009 |
| Replies: 15 Views: 991 Welllll, you COULD enter CTRL-A to get Monday, CTRL-B for Tuesday... (but I wouldn't recommend it).
I like some form of menu in this case, something like:
What day of the week is it? (1-Sunday,... |
Forum: C Dec 29th, 2008 |
| Replies: 9 Views: 539 somnathsarode if you are going to post code, especially in response to a thread, please use the appropriate code tags.
For this forum:
/* your code goes here */
Your response followed the... |
Forum: C Dec 28th, 2008 |
| Replies: 9 Views: 539 Not to be picky, but #define NUMBERS is a pre-processor directive and doesn't get scope.
(But it should have been outside the function anyway.) |
Forum: C Dec 23rd, 2008 |
| Replies: 7 Views: 797 char cmd[3]; // 3 byte array [0] [1] [2]
memcpy(cmd,packets,3); // cmd contains 'MSG' (confirmed)
if (cmd == "MSG") // not working
// try memcmp(cmd, "MSG", 3) == 0
{
PA_OutputText(1, 1,... |
Forum: C Dec 23rd, 2008 |
| Replies: 7 Views: 797 or, you at least need another index for the characters you put into packets. When you switch to a new x index, you need to reset the output index to 0.
void split(char *original)
{
int x =... |
Forum: C Dec 10th, 2008 |
| Replies: 2 Views: 958 At least part of the problem is in your last set of code...
The tempptr was null, so you allocated and initialized it, but tempptr was just a copy of the pointer from current[target[i]] you made... |
Forum: C Dec 9th, 2008 |
| Replies: 8 Views: 1,252 I will comment however that users tend to like things to start at 1 rather than 0.
If I'm asking a user questions, it makes more sense to them to answer questions 1 - 10 rather than questions 0 -... |