Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #1K
~19.5K People Reached
Favorite Forums
Favorite Tags
c++ x 50
c x 10

39 Posted Topics

Member Avatar for djbsabkcb

It is printing the number multiple times, becuse of: [CODE] for ( int j = 2; j <= i/2; j++) { if ( i % j == 0 ) { check_prime = 0; } if ( check_prime != 0 ) { cout << i << endl; } }[/CODE] here you …

Member Avatar for duskoKoscica
-2
2K
Member Avatar for jepapel
Member Avatar for Mike182

From [url]http://www.daniweb.com/techtalkforums/showthread.php?t=27800[/url] [QUOTE=Narue]You're using a Win32 application project when you want a console application project. Win32 applications expect WinMain instead of main.[/QUOTE] use <iostreram> instead of <iostreram.h>

Member Avatar for Jessica Garcia
0
123
Member Avatar for iamnoangel26

>Ok But how can i get the value of the 5th element? does cout<<a[5]; will do? well,it will ouput the 6'th element, since arrays start on 0. >And what if i want to output all the elements? do I write cout<<a[0], a[1], a[2]... a[20]; yes, but [20] dont exist, since …

Member Avatar for gazoo
0
214
Member Avatar for dark7angelx07

to call the function prime, it is just to add: prime(loop) a simple loop condiction is: (n/2)+1 > i since after 1/2 of the val of n there cant be a fraction of the n number. and the test are simple ennuf: if (n%i == 0)

Member Avatar for DavidB
0
1K
Member Avatar for kjpwa

you are adding counter twice in your loop, need to remove one. [code]void primeTest(int n) { int temp = 2; for (int counter=1; counter<=n; counter++) { cout << "Prime number " << counter << " is " << temp << endl; // counter ++; need to be comented out or …

Member Avatar for ANUJ SHROTRIYA
0
827
Member Avatar for bops

Words are generaly seperated by spaces, so look for spaces between charaters.

Member Avatar for Narue
0
179
Member Avatar for badchick

You can do somthing like this: #include <iostream> using namespace std; int main() { char test[] = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.!:;? ";// all the chars you are testing for int size = sizeof(test)/sizeof (char); // size of test array int counter[size]; // make array of int's string s1; cout << "enter stringn"; cin …

Member Avatar for Dave Sinkula
0
477
Member Avatar for BenBen84

It might be that you are linking with some dll's that aint in the folder you are executing from or in the system folder. try to look at the propeties for the project in VC and see if they link to some files. and if try to copy them into …

Member Avatar for BenBen84
0
334
Member Avatar for iamthwee

you can do somthing like this: [CODE] #include <iostream> using namespace std; int main() { int num = 50; // test num bool done = false; // for tetsing if done while (!done) { done = true; if(num % 2 == 0) // testing if 2 is a factor of …

Member Avatar for bops
0
387
Member Avatar for altheastronut

[Code] file<<"%d file\n",rand(); [/CODE] cant be dont this way, it is not printf() that you are using :) try: [CODE] file << rand() << " file\n"; [/CODE]

Member Avatar for zyruz
0
101
Member Avatar for JoBe
Member Avatar for Dave Sinkula
0
447
Member Avatar for cjones5499

becuse you dont use CODE tags. [url]http://www.daniweb.com/techtalkforums/announcement8-3.html[/url]

Member Avatar for Stoned_coder
0
2K
Member Avatar for evilsilver

well it is kinda har to guess wath you want for req's when I have no idea wath max req's and sutch are, so I'l just poste some name: Weapons: Hammer of Thor (pref do some extra lightning dam :) ) Sling of Goliat Deaths sausage Devils tothpick Jewlery Odins …

Member Avatar for Drowzee
0
414
Member Avatar for hfaucette

[CODE] for(int i = 0; i < 512; i++) { output[i].var1 = (double *)i; output[i].var2 = (double *)i; output[i].var3 = (double *)i; } [/CODE] shuld populate it.

Member Avatar for bumsfeld
0
153
Member Avatar for Mike182

the probleme is that you have declared log as a float. and a float is not a function and a float variable cant be used as a function. so ether change (150*log(pl/1.5)); to (150*std::log(pl/1.5)); or remove the log float.

Member Avatar for Mike182
0
322
Member Avatar for mozira
Member Avatar for karen_CSE

Dont try to print out a void function. change cout << Backward(line) << endl; to Backward(line); cout << endl;

Member Avatar for karen_CSE
0
1K
Member Avatar for karen_CSE

why do you need to have this as a 2d array? if you just want the numbers 1-20, you can change the function StudentAns to: [CODE] void StudentAns(char answer[20]) { for (int quest = 1; quest <=20; quest++) { cout << "Please enter your choice for Question " << quest …

Member Avatar for Drowzee
0
509
Member Avatar for jepapel

[QUOTE=jepapel]How a correct initialazation of arrays would be correct? static const char alphabet[] = "a=10, b=25, c=30"; //and so on i get a compiler error when i initialize like this...[/QUOTE] You can do it like this: [CODE] #include <iostream> struct alphab { int num; char ch; }; int main() { …

Member Avatar for zyruz
0
338
Member Avatar for jepapel

If I aint totaly wrong Dave ment somthing like this: [CODE] char ch[] = "abcdefghijklmnopqrstuvwxyz"; // character array char testc = 'c'; // wath we are looking for int res = -1; for (int i = 0; ch[i] != '\0'; i++) // loop thru ch, untill it reach the end. …

Member Avatar for zyruz
0
299
Member Avatar for karen_CSE

Well you have newer declared i, before refering to it in [Code]if(!count[i] % 2) // if divisible by 2, then returns zero, negates to 1, enters if even[i] = count[i]; else odd[i] = count[i];[/Code] just so you know, you havent declared even or odd as array ether.

Member Avatar for karen_CSE
0
359
Member Avatar for k_en

somthing like this: [CODE] #include <iostream> int main () { char c[6] = "45678"; int num[5]; for (int i = 0; i < 5; i++) { char temp = c[i]; num[i] = atoi(&temp); std::cout << num[i] << std::endl; } system("pause"); }[/CODE]

Member Avatar for Drowzee
0
375
Member Avatar for mixsir

Your main probleme is that you have bad design. Try to figure out how to do somthing before you try to code it :). But, I rewritten your code: [CODE] #include <iostream> // use <iostream> instead for <iostream.h> using namespace std; int main() { int i=0 ; int j=0 ; …

Member Avatar for zyruz
0
113
Member Avatar for Decessus

Your probleme lies in[CODE] if (myDifficulty = 3) [/CODE] You are only asigning the value 3 (or 1 or 2) to the myDiffculty, change the '=' too '==' and it shuld work. You arent using the enum difficulty.... if you change the testing to: [CODE] if (myDifficulty == Easy) [/CODE] …

Member Avatar for zyruz
0
647
Member Avatar for freemind
Member Avatar for zyruz
0
127
Member Avatar for Decessus

just change the [CODE]cin.ignore(std::cin.rdbuf()->in_avail() + 1);[/CODE] to [CODE]cin.ignore(std::cin.rdbuf()->in_avail() + 2);[/CODE]

Member Avatar for Dave Sinkula
0
245
Member Avatar for desidude

desidude: try somthing like this: [CODE] std::string Hex(int num) { std::string s1; char sign[] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; int div, base = 16; while (num >= 1) { div = num % base; num = num / base; s1 = sign[div] + s1; } return s1; } [/CODE]

Member Avatar for Kazastankas
0
265
Member Avatar for Savior
Member Avatar for Savior
0
113
Member Avatar for bandm

(edit2)Take a look on:[url]http://www.daniweb.com/techtalkforums/thread27267.html[/url]

Member Avatar for bandm
0
446
Member Avatar for desidude

Just put the [CODE] sum = sum+val; count=count++;[/CODE] inside your while loop, and it shuld work.

Member Avatar for desidude
0
225
Member Avatar for djbsabkcb

[CODE] long jul =static_cast<long>(floor(365.25 * j_year) + floor(30.6001 * j_month) + j_day + 1720995.0); [/CODE] first of. 1720995.0 shuld be changed to 1720994.5 and second. remove the floor() - and it is doing it corectly. >Could you better describe the problem? As far as I know it is showing 1 …

Member Avatar for zyruz
0
639
Member Avatar for logic321

you can use somthing like this to loop thru your array: [CODE] #include <iostream> int main () { int pay[] = {500000,300000,230000,156740}; int size = sizeof(pay) / sizeof (int); // find number of elements in pay[] for (int i = 0; i < size; i++) // loop thru pay[] { …

Member Avatar for Narue
0
393
Member Avatar for mr. President

You have multiple errors in your code: [CODE] int getData (int numbers [], int size, int range); //....... size= getData (nums, dMAX); [/CODE]You are calling the function with too few argument's. [CODE] while (loader < size && (fsData >> dataIn)) [/CODE]You havent declared fsData. [CODE] data [loader+=] = dataIn; [/CODE]This …

Member Avatar for mr. President
0
135
Member Avatar for BioTechNoob

well, as a general tip for this forum, put your code in BB tags so one can see whitespaces.

Member Avatar for zyruz
0
131
Member Avatar for gmrod

if you starte out whit this numbers: num1 = 4 num2 = 3 num3 = 2 num4 = 1 and if you look at your code you will see the numbers change like this: num1 = 3 num2 = 4 num3 = 2 num4 = 1 num1 = 3 num2 …

Member Avatar for zyruz
0
96
Member Avatar for somer2412

I found a few things you might want to look at: [CODE]for (WS = Min_Wind; WS >=Max_Wind; WS += 10)[/CODE] you want to do this while WS is lager than Max_Wind? think that WS <= Max_Wind is better. [CODE]for (temp = AirT; AirT < 50; temp -= 5)[/CODE] you are …

Member Avatar for zyruz
0
140
Member Avatar for cpp noob

simple examlpe of getline: [CODE] char input[55]; cin.getline(input,55); [/CODE]

Member Avatar for cpp noob
0
305
Member Avatar for mina1984

The End.