Search Results

Showing results 1 to 17 of 17
Search took 0.00 seconds.
Search: Posts Made By: alkeshtech ; Forum: C++ and child forums
Forum: C++ May 5th, 2008
Replies: 12
Views: 892
Posted By alkeshtech
char ch = '—';

cout << static_cast<int>(ch);


The output is -105.

I tried isprint(), but it still gives an error.
Forum: C++ May 4th, 2008
Replies: 12
Views: 892
Posted By alkeshtech
Is there a way to check if we've got one of the extended ASCII codes in C++? Because, I am reading from a file that contains '—', and because of that I get a "Debug assertion failed: (unsigned)(c+1)...
Forum: C++ May 4th, 2008
Replies: 12
Views: 892
Posted By alkeshtech
thanks a lot man. it works now.

Just one more thing,
What are the not printable characters for C++?
One that I found is —. That is not minus(-).
Forum: C++ May 4th, 2008
Replies: 12
Views: 892
Posted By alkeshtech
I haven't used vector before, but that looks easy using vectors. How would I compare say, "Alkesh" in the vector "theList".
Forum: C++ May 4th, 2008
Replies: 12
Views: 892
Posted By alkeshtech
Ok. What I meant by getting the string twice is that, I am getting all the words 1st time just to know how many words are there. Then, 2nd time I am doing same thing but now I am actually storing...
Forum: C++ May 4th, 2008
Replies: 12
Views: 892
Posted By alkeshtech
Hey Guys,
I want to read from a file. And store the string in a string class array. Number of strings in the file is unknown. How could this be done?

int n=0;
while(!inFile2.eof())
{...
Forum: C++ May 2nd, 2008
Replies: 3
Views: 1,762
Posted By alkeshtech
ok, line count should work. But, words in our program aren't supposed to include non alphabetic characters. How would I go about that?
Forum: C++ May 2nd, 2008
Replies: 3
Views: 1,762
Posted By alkeshtech
Hey Guys,
So, I am writing a program that reads in from a file, and prints the word and counts the number of lines in the document. Here is the function that is supposed to do the work. Every time I...
Forum: C++ Apr 1st, 2008
Replies: 10
Views: 915
Posted By alkeshtech
yes, [0,100].
So, could I just modify it like the following?
std::random_shuffle ( a, a + 101 );
Forum: C++ Apr 1st, 2008
Replies: 10
Views: 915
Posted By alkeshtech
so, how would I go about modify random shuffle code that you wrote, for 5 random numbers and range [0,100]?
Forum: C++ Apr 1st, 2008
Replies: 10
Views: 915
Posted By alkeshtech
would that work for larger range, if change n to 100? My goal is to create 5 random numbers from 1 to 100 without repetition.
Forum: C++ Apr 1st, 2008
Replies: 10
Views: 915
Posted By alkeshtech
I ask because it works alright for larger range, but If I change the range to 0 to 4 instead of 0 to 20. I do get repetition. Is it possible to modify it a bit to get 100% no repetition?
Forum: C++ Apr 1st, 2008
Replies: 10
Views: 915
Posted By alkeshtech
hey guys,
I want to create 6 different random numbers without repetitions and this what I have done. I just wanted to make sure if this logic makes sense.

for(int n=0 ; n<6 ; n++)
{...
Forum: C++ Mar 20th, 2008
Replies: 6
Views: 548
Posted By alkeshtech
thanks man. It works now. Could you check if it everything is okay?
You see any places for improvement?
void profile::createProfile()
{
ProfileType *newProfile;
ProfileType *profilePtr;...
Forum: C++ Mar 19th, 2008
Replies: 6
Views: 548
Posted By alkeshtech
yep, i had head == NULL instead of head = NULL.
thanks.
now, can i put the following code into another function say generateRandomProfile()?

newProfile->countryOfOrigin =...
Forum: C++ Mar 19th, 2008
Replies: 6
Views: 548
Posted By alkeshtech
thanks man, got it working but now a new problem.


int profile::randomNumGenerator(int min, int max)
{
int random_integer;

int range=(max-min)+1;

random_integer =...
Forum: C++ Mar 19th, 2008
Replies: 6
Views: 548
Posted By alkeshtech
why is this keep giving me same 2 numbers?

#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdlib>
#include <windows.h>
using namespace std;

int generate(int,int);
Showing results 1 to 17 of 17

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC