Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

printf with char pointer #366

Open
IngeniariusSoftware opened this issue Sep 10, 2022 · 0 comments
Open

printf with char pointer #366

IngeniariusSoftware opened this issue Sep 10, 2022 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@IngeniariusSoftware
Copy link
Member

remove the line if it fixed in the testcuite:

00173: TODO printf with char pointer

the test:
https://github.com/c-testsuite/c-testsuite/blob/master/tests/single-exec/00173.c

#include <stdio.h>

int main()
{
   int x = 'a';
   char y = x;

   char *a = "hello";

   printf("%s\n", a);

   int c;
   c = *a;

   char *b;
   for (b = a; *b != 0; b++)
      printf("%c: %d\n", *b, *b);

   char destarray[10];
   char *dest = &destarray[0];
   char *src = a;

   while (*src != 0)
      *dest++ = *src++;

   *dest = 0;

   printf("copied string is %s\n", destarray);

   return 0;
}

/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
@IngeniariusSoftware IngeniariusSoftware added the bug Something isn't working label Sep 10, 2022
@YaRiabtsev YaRiabtsev self-assigned this Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants