Click here to Skip to main content
15,918,003 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
// testClass.cpp : main project file.

#include "stdafx.h"
#include "stdio.h"

using namespace System;

class aClass
{
    public aClass(char *partnumber)
  {
    printf("%s",partnumber);
  }

};

int main(array<System::String ^> ^args)
{

    aClass a("Hello");

    Console::WriteLine(L"Hello World");
    return 0;
}
Posted
Updated 1-Jul-11 14:47pm
v3
Comments
Sergey Alexandrovich Kryukov 1-Jul-11 20:47pm    
There is nothing about C++/CLI here! I changed the tag.
--SA

<code>
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
class A
{
public:
    A(char* p)
    {
        printf("%s",p);
    }
};


void main()
{
    A A1 = "Test";
    
}</code>
 
Share this answer
 
try

C#
class aClass
{
  public:

  aClass(char *partnumber)
  {
    printf("%s",partnumber);
  }

};


you've confused C# and C++ declarations
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900