Click here to Skip to main content
15,900,449 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Font Size with 900. Pin
Eddy Vluggen8-Apr-09 21:24
professionalEddy Vluggen8-Apr-09 21:24 
GeneralRe: Font Size with 900. Pin
Anubhava Dimri8-Apr-09 21:52
Anubhava Dimri8-Apr-09 21:52 
QuestionHow to add a "variable" to a delegate .. Can I do This ? Pin
Georg Kohler7-Apr-09 18:16
Georg Kohler7-Apr-09 18:16 
AnswerRe: How to add a "variable" to a delegate .. Can I do This ? Pin
Christian Graus7-Apr-09 18:46
protectorChristian Graus7-Apr-09 18:46 
GeneralRe: How to add a "variable" to a delegate .. Can I do This ? Pin
Georg Kohler7-Apr-09 19:01
Georg Kohler7-Apr-09 19:01 
GeneralRe: How to add a "variable" to a delegate .. Can I do This ? Pin
Christian Graus7-Apr-09 19:05
protectorChristian Graus7-Apr-09 19:05 
AnswerRe: How to add a "variable" to a delegate .. Can I do This ? Pin
Skymir8-Apr-09 8:13
Skymir8-Apr-09 8:13 
QuestionHelp PLEASE!!! Pin
JasonSprosty7-Apr-09 15:07
JasonSprosty7-Apr-09 15:07 
I am having some problems with the code I am writing.. here is the error message I'm getting:

error C2664: 'getFirst' : cannot convert parameter 1 from 'char (*)[100]' to 'char *'

And here is the code that is involved..

#include <iostream>
#include <cstdlib>

using namespace std;

bool getFirst(char *);
bool getLast(char *);

void main()
{
char firstName[100];
char lastName[100];
bool validFName;
bool validLName;
int first;
int last;
int length;


do
{
cout << "Enter your first name in lowercase letters: ";
validFName = getFirst(&firstName);
if (!validFName) cout << "Invalid entry. Try again...\n";
} while (!validFName);

cout << "\n";

do
{
cout << "Enter your last name in lowercase letters: ";
validLName = getLast(&lastName);
if (!validLName) cout << "Invalid entry. Try again...\n";
} while (!validLName);



cout << "\nYour full name is " << firstName << " " << lastName << "\n";
first = strlen(firstName);
last = strlen(lastName);
length = (first + last);
cout << "\nYour full name has " << length << " characters\n";

}

bool getFirst(char *first)
{
int iF,lenF;
char bufFirst[100];
bool validFirst = true;

cin.getline(bufFirst,100);
lenF = strlen(bufFirst);
iF = 0;
while (validFirst && iF < lenF)
{
if ((bufFirst[iF] < 'a') || (bufFirst[iF] > 'z'))
validFirst = false;
iF++;
}

return validFirst;
}

bool getLast(char *last)
{
int iL,lenL;
char bufLast[100];
bool validLast = true;

cin.getline(bufLast,100);
lenL = strlen(bufLast);
iL = 0;
while (validLast && iL < lenL)
{
if ((bufLast[iL] < 'a') || (bufLast[iL] > 'z'))
validLast = false;
iL++;
}
return validLast;
}


I cannot figure out how to get the correct output.. It displays crazy characters and says that my string length is 330 characters long..

Any help with this please??
AnswerRe: Help PLEASE!!! Pin
Luc Pattyn7-Apr-09 15:24
sitebuilderLuc Pattyn7-Apr-09 15:24 
AnswerRe: Help PLEASE!!! Pin
Christian Graus7-Apr-09 17:54
protectorChristian Graus7-Apr-09 17:54 
QuestionVB 2005 Case Programming Assignment 5 page 871 source code Pin
twiztid_sickz7-Apr-09 11:56
twiztid_sickz7-Apr-09 11:56 
AnswerRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Dave Kreskowiak7-Apr-09 12:05
mveDave Kreskowiak7-Apr-09 12:05 
AnswerRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Wes Aday7-Apr-09 12:25
professionalWes Aday7-Apr-09 12:25 
AnswerRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Yusuf7-Apr-09 12:30
Yusuf7-Apr-09 12:30 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Luc Pattyn7-Apr-09 12:39
sitebuilderLuc Pattyn7-Apr-09 12:39 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Yusuf7-Apr-09 12:48
Yusuf7-Apr-09 12:48 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Luc Pattyn7-Apr-09 13:13
sitebuilderLuc Pattyn7-Apr-09 13:13 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Yusuf7-Apr-09 13:24
Yusuf7-Apr-09 13:24 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Luc Pattyn7-Apr-09 13:55
sitebuilderLuc Pattyn7-Apr-09 13:55 
AnswerRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
twiztid_sickz7-Apr-09 12:37
twiztid_sickz7-Apr-09 12:37 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Luc Pattyn7-Apr-09 12:40
sitebuilderLuc Pattyn7-Apr-09 12:40 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Yusuf7-Apr-09 12:43
Yusuf7-Apr-09 12:43 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
twiztid_sickz7-Apr-09 12:51
twiztid_sickz7-Apr-09 12:51 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Yusuf7-Apr-09 12:55
Yusuf7-Apr-09 12:55 
GeneralRe: VB 2005 Case Programming Assignment 5 page 871 source code Pin
Jon_Boy8-Apr-09 4:49
Jon_Boy8-Apr-09 4:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.