![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 48
Rep Power: 0
![]() |
Convert char[14] to char *
How to convert char chA[14] to char *pointerA???
ifstream myInputFile("thisFile.txt");
if( !myInputFile )
{
perror("File could not be opened");
}
char chA[14];
myInputFile.getline(chIPAddress, 14, '\n');I need to convert to char *, becouse of this: sockaddr_in clientService; clientService.sin_addr.s_addr = inet_addr( pointerA ); i try to use char chA for inet_addr(chA), but it has error. Please help... thanks |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I recommend you begin by reading up on pointers. There's a link in my signature to "pointer basics". While there is some equivalency between pointers and arrays, they are not precisely the same thing.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|