|
Respected all
Regards!
i used the following code.
----------------------------------------------------------
pFile=fopen("C:\\filename.dat","r");
and my "filename.dat" is in the follwing form.
----------------------------
sfsd
sdfgsfg
dsfgsfg
sgsfg
X Y Z Indix
12 33 45 3335
12 34 45 2323
12 34 34 3434
---------------------------------------------------
and there are several file like the above but in different total no, of lines.
so how i can find out the total no, lines in a file.like in above but remember
that the file may be n different size.
waiting for + response.
david
|
|
|
|
|
Are you using C++ or C ? fopen is C. ifstreams are C++. In C++, reading a file with an ifstream, you can use the getline function to read a line at a time, and of course, you can keep count as you do so.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi all
how to place a animated icon on the caption bar, similar what we see in Internet Explorer.
if any one has any idea, please share it with me.
thanks and regards
pradish
|
|
|
|
|
I have error when I compile my program.Can someone tell me what is unresolve external error....
|
|
|
|
|
|
It's a sign from God. If you want more info, try posting the actual error, so we have something to work with.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
#include <afxsock.h>
#include <iostream.h>
#include <winsock.h>
#include <stdlib.h>
int doit(int, char **)
{
char ac[80];
if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR)
{
cerr << "Error " << WSAGetLastError() <<
" when getting local host name." << endl;
return 1;
}
cout << "Host name is " << ac << "." << endl;
struct hostent *phe = gethostbyname(ac);
if (phe == 0)
{
cerr << "Yow! Bad host lookup." << endl;
return 1;
}
for (int i = 0; phe->h_addr_list[i] != 0; ++i)
{
struct in_addr addr;
memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
cout << "Address " << i << ": " << inet_ntoa(addr) << endl;
}
return 0;
}
int main(int argc, char *argv[])
{
WSAData wsaData;
if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
{
return 255;
}
int retval = doit(argc, argv);
WSACleanup();
return retval;
}
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/TEST.exe : fatal error LNK1120: 2 unresolved externals
|
|
|
|
|
an unresolved external symbol linker error occurs when a compiled file (but not linked yet) uses an external symbol, such as a function or a variable declared as extern , but found nowhere in the reste of the project files.
that's why we have to #include some files sometimes...
the linker cannot find for beginthreadex() and endthreadex() for two major reasons...
1) you didn't wrote the function names correctly (C/C++ are case sensitive, so be careful to the caps...).
2) you don't include the correct header file (.h)where these two functions are defined. as they are standard headers (not defined in your project, but in one of the compiler folder), use #define<>.
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Do you mean I need to add in #define beginthreadex and #define endthreadex at the beginning of the program
|
|
|
|
|
#define ???? no never, i never talked about that, i said #include
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
After I add the #include <beginthread> and #include <endthread>
its still got error
error C1083: Cannot open include file: 'beginthreadex': No such file or directory
|
|
|
|
|
please edit your previous post and uncheck the "Do not treat <'s as HTML tags" checkbox down EditBox you type the post
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
the #include file is not in the same directory where ur application is present
so #include foldername//abc.h
foldername in which abc.h is present
|
|
|
|
|
Tsaejen wrote:
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Check this link[^]
and this other link[^]
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
|
Ritu Kwatra wrote:
Hope it will solve ur problem
nice
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Christian Graus wrote:
It's a sign from God.
That's not very Christian of you. Oh wait...
(I'm sorry, but you left yourself wide open on this one)
Software Zen: delete this;
|
|
|
|
|
When I build a console application , it always appears with the default application icon (the blue buildings). How can I change this icon?
river
|
|
|
|
|
Have you tried simply adding an icon to your app using the resource editor in Visual Studio? That should be enough.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Many peoply have told me do this,
But,it was console application. There hasn't any resource file
|
|
|
|
|
|
It was console application.
There hasn't any resource view....
|
|
|
|
|
I say a more time : CONSOLE APPLICATION
|
|
|
|
|
|
I've just tried to do this, and managed to get it to work. Here's what you do...
In VC++, select the following menu item: "Project" -> "Add To Project" -> "New..."
From the resulting window select to add a Resource Script (give it any name, I don't think it matters). You'll now have a "Resources" tab added to your project from which you can right-click and do "Insert...", and select Icon from the resulting box. Then just edit your icon.
Worked for me.
I guess it would work just as well if you selected "Import..." instead of "Insert...", and selected a pre-defined .ico file.
Hope this helps, 'bod
|
|
|
|