Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
7
Posts with Upvotes
6
Upvoting Members
5
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
Ranked #2K
~13.0K People Reached
Favorite Tags
c x 19
c++ x 9

20 Posted Topics

Member Avatar for Rayhana

Are you programming in C (file extension .c) or in C++ (file extension .cpp)?

Member Avatar for mcriscolo
0
158
Member Avatar for pjh-10

[QUOTE=pjh-10;1770135][CODE]#include <iostream> #include <cstdlib> #include <ctime> #include <cmath> using namespace std; int main() { int song[1000]; int n; srand(time(0)); for (int i=0; i<1000; i++) { song[i] = i; } while (cin >> n) { for (int i=0; i<(1000-1); i++) { int r = i + (rand() % (1000-i)); int temp …

Member Avatar for pjh-10
0
442
Member Avatar for phorce
Member Avatar for kase20

The minimum range for int is -32767 to +32767. If your compiler (also known as implementation) is at this minimum, int is not large enough to store 6 digits. However, many implementations have a much larger range so that may not be your problem. You may want to look values …

Member Avatar for Ancient Dragon
0
107
Member Avatar for sibwolf

Multiposts [Here](http://www.dreamincode.net/forums/topic/271931-output-prime-and-perfect-numbers-between-1-and-1000/)

Member Avatar for pheininger
0
191
Member Avatar for meme meme

[QUOTE=meme meme;1780752]how can i check if the number is positive or not by using switch statement[/QUOTE] [QUOTE=WaltP;1780786]Use the % operator in the SWITCH statement. You know what values you will get so use those values in the CASE statements.[/QUOTE] Walt, note that I am not the OP. I am getting …

Member Avatar for Tygawr
0
140
Member Avatar for megaman656

[QUOTE=megaman656;1772733]for example, i want to combine two number 6 and 8 and it will equal 68. is this possible in C? [ICODE]int a = 6, b = 8,c; c=ab; [/ICODE] and c will = 68.[/QUOTE] Yes it is possible, but not the way you have shown. Your assignment statement assigns …

Member Avatar for VernonDozier
0
105
Member Avatar for arold10

[QUOTE=arold10;1769607]I want to write this function integerPower(base, exponent) that return the value of base^[I]exponent[/I] For instance integerPower(3, 4) = 3*3*3*3 The function has two parameters my question is how can I use the for loop to control the calculation? It's not that hard to use the for loop when the …

Member Avatar for arold10
0
316
Member Avatar for mkab

[QUOTE=gerard4143;1493498]The only reason to put header files in makefile is to check to see if they exist. [/QUOTE] No, the reason to include header files in a make file is so that if the header file is updated, but the source file that includes it has not been updated, that …

Member Avatar for gerard4143
0
317
Member Avatar for b56r1

[QUOTE][CODE]printf("%d %d %d\n",a=10,a=20,a=30); [/CODE][/QUOTE] The language standard indicates this statement has "undefined behavior" because the variable a is changed more than once between two squence points (start of the statement and before the function call but after all the parameters have been evaluated). In this case, there are three assignment …

Member Avatar for pheininger
0
110
Member Avatar for banders7

[QUOTE=Ancient Dragon;1311829]Borland does have modern 32-bit/64-bit compilers, they are not free. The only free Borland compilers are ancient and obsolete. I can't vouch for how good or bad the newest Borland compilers are because I don't use them. But since Borland is still in business I suppose enough people/companies are …

Member Avatar for Azar Mohamed
-3
4K
Member Avatar for gudads

[QUOTE=prvnkmr449;1325287]... Both are correct and have no problem at all. ...[/QUOTE] For a hosted environment, only the second version is explicitly given in the C99 standard. The first is only valid if it is covered under the "or in some other implementation-defined manner." clause.

Member Avatar for gudads
0
117
Member Avatar for creeps

[QUOTE=cezar.elnazli;1307386]I'm trying to validate a day of the month, so that if the user enters a negative value or a value above 31, the program prints an error message and prompts for another day. The code below doesn't work as expected. Instead, it gets caught inside an infinite loop, printing …

Member Avatar for Adak
0
330
Member Avatar for gahhon

[QUOTE=gahhon;1302403]this is what i had tried assign the value of monthly sales into a variable, after that only switch statement. [CODE]#include <stdio.h> void main() { int monthly_sales, a; double monthly_income; printf("Enter your monthly sales amount > "); scanf("%d", &monthly_sales); if(monthly_sales >= 50000) a = monthly_sales; switch(monthly_sales) { case 'a': { …

Member Avatar for Adak
0
178
Member Avatar for daredevil786

[QUOTE=daredevil786;1301628]i know that but i want to know the reason behind it why its happening[/QUOTE] It is happening because in [I]The C Programming Language [/I]by Brian W. Kernighan & Dennis M. Ritchie (Prentice Hall 1978) on page 147 (based on 15th printing) where it is finishing its description of the …

Member Avatar for MareoRaft
0
123
Member Avatar for ftl25

[QUOTE=gerard4143;1305129]Try something like [code] #include <stdio.h> typedef void (*myfunction)(void); void TSL1_ReadMemory32() { fputs("called!\n", stdout); } struct { myfunction thefunct; const char* functionName; }lookUpTable[] = { {TSL1_ReadMemory32, "ReadMemory32"}, {NULL, NULL} }; int main() { lookUpTable[0].thefunct(); return 0; } [/code][/QUOTE] gerard4143: Why are you suggesting a typedef for the function? I am …

Member Avatar for gerard4143
0
2K
Member Avatar for Interrupt

[QUOTE=Ancient Dragon;1300024]You said it was 16-bit console. Unix has never been a 16-bit operating systm. ...[/QUOTE] My rememberence was that *nix started on the DEC PDP-11 which was a 16-bit computer. After checking with wikipedia, the current version of the article indicates that the team started on the DEC PDP-7. …

Member Avatar for $urya
0
3K
Member Avatar for ellenski

On just a quick review, does this version even compile without error? Lines 115 and 116 use variables which are not defined locally: parent and location. If the condition in line 105 is true on the first pass through the loop, p will not be initialized when used in lines …

Member Avatar for abhimanipal
0
164
Member Avatar for rohith_08

[QUOTE=vinotharose;1302970]please allow me to access the telephone directory.[/QUOTE] vinotharose: Please read the [URL="http://www.daniweb.com/forums/thread78060.html"]"Read This Before Posting"[/URL] thread especially the section entitled "Don't resurrect old threads!". My answer to your question for the United States is to direct you to the [URL="http://www.att.com/gen/general?pid=10908"]Directory Resources[/URL] page of AT&T. Other United States telephone companies …

Member Avatar for pheininger
0
246
Member Avatar for daredevil786

[QUOTE=daredevil786;1301509]first of all thanks for all this and i want to know is it legal to have one side pointer arithmetic and on one side a int variable and i was saying it to be 8 because ptr is pointing to a integer variable so there should be a difference …

Member Avatar for pheininger
0
1K

The End.