|
DisplayString.cpp(21) : error C2065: 'stringArray' : undeclared identifier
DisplayString.cpp(21) : error C2109: subscript requires array or pointer type
DisplayString.cpp(23) : error C2109: subscript requires array or pointer type
for(int i = 0; stringArray[i] != 0; i++)
I'm Using a book called C++ For dummies & I'm sure I copied the code word to word......
Do not go gentle into that good night,
Old age should burn and rave at close of day
Rage, rage against the dying of the light - Dylan Thomas
|
|
|
|
|
I think you forgot to include the header file where stringArray is declared in DisplayString.cpp
|
|
|
|
|
// DisplayString - output a character array to
// standard output, the MS-DOS window
#include <stdio.h>
#include <iostream.h>
// prototype declarations
void displayString(char stringArray[]);
int main(int nArg, char* pszArgs[])
{
char charMyName[] = {'H', 'a', 'n', 's', 'v', 'e', 'e', 'r', 0};
displayString(charMyName);
cout << "\n";
return 0;
}
// displayString - display a character string
// one character at a time
void displayString(char StringArray[])
{
for(int i = 0; stringArray[i] != 0; i++)
{
cout << stringArray[i];
}
}
Could you please tell me what's wrong.... I really cant figure this one out
Do not go gentle into that good night,
Old age should burn and rave at close of day
Rage, rage against the dying of the light - Dylan Thomas
|
|
|
|
|
Psych0hans wrote:
void displayString(char StringArray[])
{
for(int i = 0; stringArray[i] != 0; i++)
{
cout << stringArray[i];
}
}
There is a mismatch between StringArray in the function arguments and stringArray used in the function. Take care of the upper-case of the names.
Change it to:
void displayString(char StringArray[])<br />
{<br />
for(int i = 0; StringArray[i] != 0; i++)<br />
{<br />
cout << StringArray[i];<br />
}<br />
}<br />
|
|
|
|
|
Hey Credic... Thanks for the help....U da man ;)
Do not go gentle into that good night,
Old age should burn and rave at close of day
Rage, rage against the dying of the light - Dylan Thomas
|
|
|
|
|
... here is why IntelliSense is so useful, especially in case-sensitive languages...
use Ctrl+Space into Visual Studio to see what i mean
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
LOL all I get is a really really really really loooooooong drop down menu of which I cant make out heads or tails
|
|
|
|
|
... but when you start writing your word, you'll see what you're looking for appearing...
just magic !
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Ty...... I shall keep this in mind.....
Do not go gentle into that good night,
Old age should burn and rave at close of day
Rage, rage against the dying of the light - Dylan Thomas
|
|
|
|
|
|
Psych0hans wrote:
Rage, rage against the dying of the light
Cool sig
~RaGE();
|
|
|
|
|
TY http://www.feath.com/story/POstory5.htm[^]
For the full poem
Do not go gentle into that good night,
Old age should burn and rave at close of day
Rage, rage against the dying of the light - Dylan Thomas
|
|
|
|
|
Hi all,
I am going to get the physical full name of the computer and also the domain of the network using VC++. Could anyone help?
~~~~ Landy
|
|
|
|
|
akayoku wrote:
get the physical full name of the computer and also the domain of the network using VC++.
use this api :- NetServerEnum
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Excuse me.
Would you mind writing a sample code to show how it works?
I have tried the help file and look for its reference. However, I do not understand how to define those variables.
Thanks.
~~~~~Landy
|
|
|
|
|
akayoku wrote:
Would you mind writing a sample code to show how it works?
Have you done some googling about NetServerEnum.
akayoku wrote:
I have tried the help file and look for its reference. However, I do not understand how to define those variables.
Any Way here is sample demonstrating use of NetServerEnum:-
http://www.codeproject.com/w2k/sumeetnetserv.asp#xx874655xx[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
How about NetWkstaGetInfo() ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hello Everybody,
I have a question regarding the usage of Export / Import XML files into MS
Project 2003.
I plan to write a client application (VC++ ) which could import a MS Project file
(Importable XML File) into MS Project without opening the MS Project 2003
application.
A manual way of reimporting an exported MS Project File is possible. i
wanted this to be done by the client application.
* This application should be able to import the project xml file into MS
Project 2003.
* also Save the project file in its primitve format ".mpp" automatically if possible.
Shall be thankful for any ideas or suggestions,
Sreenivas MK
mksreenivas
|
|
|
|
|
I have an application that that loads some dll's at runtime. I am trying to design a message mechanism so that I can pass messages back and forth to and from the dll.
I have the following function in my dll:
OnMessage( CSystem * pSys, CMessage * pMsg );
And then in my exe I have the following function in my CSystem class:
OnMessage( CMessage * pMsg );
So the first function is intended to pass messages to the dll and the second function is so that the dll can pass messages back to the exe.
In the dll's OnMessage() I would like to be able to call the following:
CMessage * pMyMessage = NULL;<br />
pMyMessage = pSys->NewMessage( "Volume-Up"); <br />
<br />
pSys->OnMessage( pMyMessage );
The classes CSystem and CMessage are defined in the exe but I want to be able to use them from my dll.
How can I give the dll access to these classes without giving the source code to the plugin?
|
|
|
|
|
Maybe by using interfaces: make these classes derive from two abstract classes. Something like:
class IMessage<br />
{<br />
virtual void Func1() = 0;<br />
};<br />
<br />
<br />
class CMessage : public IMessage<br />
{<br />
void Func1();<br />
}<br />
All the functions will be defined in the .cpp file of the CMessage class. Thus, you only need to provide the header file from the IMessage and ISystem.
All your function in the dll will receive a pointer to IMessage or ISystem instead of CMessage and CSystem.
With this example, only the exe will be able to instantiate CSystem and CMessage classes. The dll will only be able to use them.
Hope this helps
|
|
|
|
|
|
--------------------Configuration: Mainscan - Win32 Debug--------------------
Linking...
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _rand already defined in libcmtd.lib(rand.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _srand already defined in libcmtd.lib(rand.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _time already defined in libcmtd.lib(time.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _sprintf already defined in libcmtd.lib(sprintf.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _memmove already defined in libcmtd.lib(memmove.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in libcmtd.lib(mbctype.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __itoa already defined in libcmtd.lib(xtoa.obj)
LINK : warning LNK4098: defaultlib "mfc42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfcs42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "mfco42d.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/Mainscan.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Mainscan.exe - 8 error(s), 4 warning(s)
Any Idea
Too many plans make the health badly...
|
|
|
|
|
you must be mix_use run_time library.
so you should be sure: the library your app based and your app use the same compile's options((/MD、/ML、/MT、/LD) .
----------------------
If you doubt yourself,then indeed you stand on shaky ground.
|
|
|
|
|
Meaning set all library projects that are part of your EXE and your EXE to use same MFC - static or dynamic.
Also set all project to use same library - MultiThreaded or not.
|
|
|
|
|
I am currently working on a project on the server side programming for Palm applications, the data from palm will transfer wirelessly to the server through Wi-Fi and i will be using CSocket programming to implement the wireless data transfer. However i wish to know whether can CSocket communicate with Palm client?
javaClaude
|
|
|
|