Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6871669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:50:02+00:00 2026-05-27T03:50:02+00:00

So, heres the deal, I’m using GTK on this one. I’m asking for Name

  • 0

So, heres the deal, I’m using GTK on this one.

I’m asking for Name on a set_entry_text. So the user enters his name and I save that variable as a char.

char *jugador1, *jugador2 ///they're in a structure

void obten_nombre (GtkWidget *widget, gpointer info)
{
  WIDGETS *elementos = (WIDGETS *)info;
  gchar *j1, *j2;

   j1=malloc(50 *sizeof(gchar));
  j2=malloc(50 *sizeof(gchar));
  strcpy(j1,gtk_entry_get_text(GTK_ENTRY( elementos->entry_j1)));
  strcpy(j2,gtk_entry_get_text(GTK_ENTRY( elementos->entry_j2)));
  strcpy(elementos->jugador1, j1);
  elementos->jj1=j1;
  // strcpy(elementos->jugador2, j2);
  g_print("Jugador1: %s\n", elementos->jugador1);
   gtk_widget_hide_all(elementos->ventana_popup2);
   gtk_widget_show_all(elementos->ventana_principe);
}

There I’m making elementos->jugador1 a char variable.

I’m making a cast:

gchar auxjugador1;

How can I make

auxjugador1 = elementos->jugador1

so I can do a

gtk_entry_set_text(GTK_ENTRY(elementos->nombre_jugador1),auxjugador1);

Thank you guys!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:50:03+00:00Added an answer on May 27, 2026 at 3:50 am

    jugador1 is NOT a char variable. It’s a char * (a pointer).

    You can’t put a pointer into a gchar.

    You can either make another pointer, and point it to the existing data, or declare an array large enough to hold a copy, then use strcpy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok heres my deal, I have a marquee like this: <marquee style=;position:absolute;left:608;top:10; font-family:Arial;font-size:24pt; color:#FFFFFF;height:153;
Alright heres the deal. I have a sports app that i want to update
Here's the deal. I have a big class hierarchy and I have this one
So here's the deal: I've got a JPanel and a JTextArea inside that one.
Here's the deal I have HTML code like this <form action=/test.php> First name: <input
Here's the deal: I'm in the process of planning a mid-sized business application that
Here's the deal... I can't get the UINavigation bar to appear on one of
Ok here's the deal I got one table with a bunch of client information.
Here's the deal. I've got a program that will load a given assembly, parse
and heres the deal. Im trying to get a few of my views to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.