This code is part of this program I'm doing. I've edited it so it would get shorter.

#include<stdio.h>
#include<string.h>

main()
{
   char zero[5][6] = {"|||||", "|   |", "|   |", "|   |" , "|||||"};
   char secOnes[5][6];

   strcpy(secOnes,zero);
   y=10;
   for(i=0;i<5;i++){
      gotoxy(20,y++);
      printf("%s", secOnes[i]);
   }
   getch();
}

When I try to compile it, it would give me the warning "Suspicious pointer in function main".

Can you guys tell me how to fix this?

I'd really appreciate it.

Thanks!

Recommended Answers

All 4 Replies

strcpy(secOnes,zero); needs to be strcpy( secOne, zero );
i needs to be declared so it does y.

Oh! I already figured it out.

I guess you can't copy multi-dimensional arrays directly.

I did this:

char zero[5][6] = {"|||||", "|   |", "|   |", "|   |" , "|||||"};
   char secOnes[5][6];
   for(i=0;i<5;i++)
      strcpy(secOnes[i],zero[i])

Sheesh.

^____^

strcpy(secOnes,zero); needs to be strcpy( secOne, zero );
i needs to be declared so it does y.

Oh, I didn't see your post.

Thanks!!

The people here are really nice.

^__^

how to solve suspicious pointer conversion

commented: By not posting on a dead thread? -1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.