|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
| Sponsored Links |
|
|
|
|||||
|
Quote:
is there any way to pass a char array of finite length as a method argument. ![]()
__________________
Anirban Chakraborty Last edited by Anirban Chakraborty; 11-30-2007 at 09:05 AM. |
|
|||||
|
I tried putting what you did show me into a class, and it compiles and runs just fine, without any errors.
Code:
#include <iostream>
typedef const char * String;
class Example
{
private:
String filename;
public:
void bas_setfn(String filename)
{
this->filename = filename;
}
};
int main()
{
Example obj;
String str = "Hello, World!";
obj.bas_setfn(str);
return 0;
}
|
|
|||||
|
I tried it with the constructor too..... It didn't work
So I did this one... Quote:
__________________
Anirban Chakraborty |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem combining c++ and .cgi | yuide | C and C++ | 2 | 04-21-2007 04:06 AM |
| just made! | Deathcry | C and C++ | 2 | 03-11-2007 02:27 PM |
| Calculator program in C | roger | C and C++ | 4 | 07-04-2006 03:24 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%