Skip to content

Commit a7f9085

Browse files
committed
C backend: Implement string type for declarations
1 parent 16c681a commit a7f9085

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libasr/codegen/asr_to_c.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ class ASRToCVisitor : public BaseCCPPVisitor<ASRToCVisitor>
114114
std::string dims = convert_dims_c(t->n_dims, t->m_dims);
115115
sub = format_type_c(dims, "bool", v.m_name, use_ref, dummy);
116116
} else if (ASRUtils::is_character(*v.m_type)) {
117-
// TODO
117+
ASR::Character_t *t = ASR::down_cast<ASR::Character_t>(v.m_type);
118+
std::string dims = convert_dims_c(t->n_dims, t->m_dims);
119+
sub = format_type_c(dims, "char *", v.m_name, use_ref, dummy);
118120
} else if (ASR::is_a<ASR::Derived_t>(*v.m_type)) {
119121
std::string indent(indentation_level*indentation_spaces, ' ');
120122
ASR::Derived_t *t = ASR::down_cast<ASR::Derived_t>(v.m_type);

0 commit comments

Comments
 (0)