Showing results 1 to 40 of 60
Search took 0.01 seconds.
Posts Made By: zyruz
Forum: C Mar 29th, 2007
Replies: 17
Views: 4,571
Posted By zyruz
Re: Prime Number program.. with a twist

you are adding counter twice in your loop, need to remove one.
void primeTest(int n)
{
int temp = 2;

for (int counter=1; counter<=n; counter++)
{
cout << "Prime number " << counter <<...
Forum: C++ Aug 26th, 2005
Replies: 8
Views: 1,434
Posted By zyruz
Re: Problems with the executable...

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...
Forum: C++ Aug 24th, 2005
Replies: 7
Views: 4,479
Posted By zyruz
Re: word count

Words are generaly seperated by spaces, so look for spaces between charaters.
Forum: C++ Aug 15th, 2005
Replies: 13
Views: 1,631
Posted By zyruz
Re: Help ME

>He said "factorial," zyruz.
My bad :)
you can also use a while loop:

#include <iostream>

using namespace std;

int main ()
{
Forum: C++ Aug 15th, 2005
Replies: 13
Views: 1,631
Posted By zyruz
Re: Help ME

you can do somthing like this:


#include <iostream>

using namespace std;

int main()
{
int num = 50; // test num
Forum: C Aug 12th, 2005
Replies: 6
Views: 2,320
Posted By zyruz
Re: Write to a file

becuse you are writing to the file after you are done with the loop. so put

file<< i <<" "<< j1 <<"\n" ;
inside the loop
Forum: C Aug 12th, 2005
Replies: 6
Views: 2,320
Posted By zyruz
Re: Write to a file

file<<"%d file\n",rand();

cant be dont this way, it is not printf() that you are using :)
try:

file << rand() << " file\n";
Forum: C++ Aug 10th, 2005
Replies: 12
Views: 2,830
Posted By zyruz
Re: Array

>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...
Forum: C Aug 8th, 2005
Replies: 7
Views: 2,847
Posted By zyruz
Re: Need help with a program, Program has to analyze a sample of text.

You can do somthing like this:

#include <iostream>
using namespace std;
int main()
{
char test[] = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.!:;? ";// all the chars you are...
Forum: C Aug 8th, 2005
Replies: 5
Views: 1,790
Posted By zyruz
Re: Need Help With Piglatin Program In C

becuse you dont use CODE tags.
http://www.daniweb.com/techtalkforums/announcement8-3.html
Forum: C++ Aug 7th, 2005
Replies: 20
Views: 3,888
Posted By zyruz
Re: Files & streams?

try to use a filname without space :)
it worked for me then
Forum: C++ Aug 3rd, 2005
Replies: 7
Views: 1,449
Posted By zyruz
Re: need an imagination i suppose.

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 :)...
Forum: C++ Aug 2nd, 2005
Replies: 8
Views: 3,751
Posted By zyruz
Re: How to display Greek (non -ASCII) in C++ Console Apps

tried using wchar_t instead of char?
Forum: C Jul 31st, 2005
Replies: 5
Views: 1,183
Posted By zyruz
Re: Vector with Multiple Memebers

if you are trying wath I think you are you need to change
struct Output
{
double *var1;
double *var2;
double *var3;
}
to

struct Output
Forum: C Jul 31st, 2005
Replies: 5
Views: 1,183
Posted By zyruz
Re: Vector with Multiple Memebers

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

shuld populate it.
Forum: C++ Jul 30th, 2005
Replies: 18
Views: 2,587
Posted By zyruz
Re: Algebraic question

I have taken a closer look on your code, and think I see wher your error is.
y = x/150*(log(pl/1.5));
and
y = x/(150*(log(pl/1.5)));
are 2 completly diferent calculation. this might be your...
Forum: C++ Jul 30th, 2005
Replies: 18
Views: 2,587
Posted By zyruz
Re: Algebraic question

log(x) ; returns the natural log of x, accept it.
Are you sure that you are thinking of log?
can you give us a couple of examples of wath you want to be done?
Guessing wath you want is...
Forum: C++ Jul 30th, 2005
Replies: 5
Views: 1,388
Posted By zyruz
Re: Moving an object up and down in C++!!

you can do it that way, but yo loose alot of readability!
Forum: C++ Jul 30th, 2005
Replies: 18
Views: 2,587
Posted By zyruz
Re: Algebraic question

log(x) is the natural logarithm of x (base e)
log10(x) is the common logarithm of x (base 10)
Forum: C++ Jul 29th, 2005
Replies: 18
Views: 2,587
Posted By zyruz
Re: Algebraic question

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...
Forum: C++ Jul 29th, 2005
Replies: 2
Views: 1,654
Posted By zyruz
Re: Special calculator help

From http://www.daniweb.com/techtalkforums/showthread.php?t=27800


use <iostreram> instead of <iostreram.h>
Forum: C++ Jul 25th, 2005
Replies: 9
Views: 3,819
Posted By zyruz
Re: backward string

Dont try to print out a void function.
change cout << Backward(line) << endl;
to
[CODE]
Backward(line);
cout << endl;
[CODE]
Forum: C++ Jul 19th, 2005
Replies: 15
Views: 3,545
Posted By zyruz
Re: 2-D array

make the key 1d?
like:
char key[20]= {'B', 'D','A','A','C','A','B','A','C','D','B','C','D','A','D','C','B', 'B','D','A'};

remove : "change answer[quest-1] = choice;" and put:

if (choise ==...
Forum: C++ Jul 19th, 2005
Replies: 15
Views: 3,545
Posted By zyruz
Re: 2-D array

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:

void StudentAns(char answer[20])
{
for (int quest = 1; quest <=20;...
Forum: C++ Jul 19th, 2005
Replies: 6
Views: 2,071
Posted By zyruz
Re: Need help with integers in c++ part 2

You can do it like this:

#include <iostream>
struct alphab
{
int num;
char ch;
};

int main()
Forum: C++ Jul 19th, 2005
Replies: 7
Views: 1,751
Posted By zyruz
Re: Need help with integers in c++

If I aint totaly wrong Dave ment somthing like this:

char ch[] = "abcdefghijklmnopqrstuvwxyz"; // character array
char testc = 'c'; // wath we are looking for
int res = -1;
for (int...
Forum: C++ Jul 18th, 2005
Replies: 9
Views: 1,899
Posted By zyruz
Re: Array

small tips:#include <iostream.h> is old style, use <iostream>, and main shuld return int (int main).

Ok, I dont know if you have loearnt about vectors, but if so, they wold be a better choise for...
Forum: C++ Jul 18th, 2005
Replies: 9
Views: 1,899
Posted By zyruz
Re: Array

Well you have newer declared i, before refering to it in 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];

just so you...
Forum: C++ Jul 17th, 2005
Replies: 4
Views: 1,660
Posted By zyruz
Re: asterisk serial form

I only recommanded that he used function, the system("pause ") was only becuse mixsir used it in his code.
Forum: C++ Jul 16th, 2005
Replies: 13
Views: 55,220
Posted By zyruz
Re: C++ prime number program help

It is printing the number multiple times, becuse of:

for ( int j = 2; j <= i/2; j++)
{
if ( i % j == 0 )
{
check_prime = 0;
}
...
Forum: C++ Jul 16th, 2005
Replies: 4
Views: 48,232
Posted By zyruz
Re: how to change char into int

somthing like this:

#include <iostream>

int main ()
{
char c[6] = "45678";
int num[5];
for (int i = 0; i < 5; i++)
{
Forum: C++ Jul 15th, 2005
Replies: 7
Views: 1,942
Posted By zyruz
Re: Menu Chooser Program

it show the menu 1,2 and 3 becuse in if (myDifficulty = 3) you aint checking, you are asigning the value 3 to myDifficulty change it to if (myDifficulty == 3)
Forum: C++ Jul 15th, 2005
Replies: 7
Views: 1,942
Posted By zyruz
Re: Menu Chooser Program

no match for 'operator>>' in 'std::cin >> myDifficulty' is the error I get, and it means that you havent declared anny overload for the >>. but use int for geting the choise, and use the enum for...
Forum: C++ Jul 15th, 2005
Replies: 7
Views: 1,942
Posted By zyruz
Re: Menu Chooser Program

Your probleme lies in if (myDifficulty = 3)
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...
Forum: C++ Jul 15th, 2005
Replies: 4
Views: 1,660
Posted By zyruz
Re: asterisk serial form

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:

#include <iostream> // use <iostream> instead for...
Forum: C Jul 13th, 2005
Replies: 1
Views: 1,514
Posted By zyruz
Re: ofstream problem

If I aint completly wrong you need to include fstream.
Forum: C++ Jul 13th, 2005
Replies: 10
Views: 1,871
Posted By zyruz
Re: Is this the forum I use for help?

Well, it cold be that dave, but he is using cin.ignore(std::cin.rdbuf()->in_avail() + 2); as a system("pause"); and there can be code afterthe pause, and then it would be a bug.
Forum: C++ Jul 13th, 2005
Replies: 10
Views: 1,871
Posted By zyruz
Re: Is this the forum I use for help?

just change the
cin.ignore(std::cin.rdbuf()->in_avail() + 1);
to
cin.ignore(std::cin.rdbuf()->in_avail() + 2);
Forum: C++ Jul 10th, 2005
Replies: 13
Views: 5,304
Posted By zyruz
Re: hexadecimal.cpp

Well for me it seems that he is trying to reinvent the wheel for a school projeckt, and not use standar function.
Forum: C++ Jul 10th, 2005
Replies: 13
Views: 5,304
Posted By zyruz
Re: hexadecimal.cpp

desidude: try somthing like this:

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 =...
Showing results 1 to 40 of 60

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:04 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC