首页 \ 问答 \ c ++将char数组传递给函数并进行更改(c++ pass char array to function and change it)

c ++将char数组传递给函数并进行更改(c++ pass char array to function and change it)

我尝试创建一个可以更改指定char数组内容的函数

void change_array(char *target)
{
    target="hi";
}

int main()
{
    char *a[2];
    change_array(a[1]);
    cout<<*(a[1]);
}

但是[1]的内容保持在0x0(无效)


I try to make a function that can change the content of a specified char array

void change_array(char *target)
{
    target="hi";
}

int main()
{
    char *a[2];
    change_array(a[1]);
    cout<<*(a[1]);
}

But then the content of a[1] stays at 0x0(void)


原文:https://stackoverflow.com/questions/18533137
更新时间:2023-12-04 18:12

最满意答案

这里有几个简单的jQuery SVG Text示例:

    // Simple jQuery SVG Text examples
    var g = svg.group(
        {fontWeight: 'bold', fontSize: '32.5', fill: 'salmon'}
    ); 
    svg.text(g, 10, 40, "Here's an example of SVG Text");         
    svg.text(g, 10, 80, "in an SVG 'group' wrapper"); 

    svg.text( 10, 130, "and without a wrapper (as an svg root)", 
        {fontWeight: 'bold', fontSize: '32.5', fill: 'gold'}
    ); 

Here are a couple simple jQuery SVG Text examples:

    // Simple jQuery SVG Text examples
    var g = svg.group(
        {fontWeight: 'bold', fontSize: '32.5', fill: 'salmon'}
    ); 
    svg.text(g, 10, 40, "Here's an example of SVG Text");         
    svg.text(g, 10, 80, "in an SVG 'group' wrapper"); 

    svg.text( 10, 130, "and without a wrapper (as an svg root)", 
        {fontWeight: 'bold', fontSize: '32.5', fill: 'gold'}
    ); 

相关问答

更多
  • jQuery UI可拖动行为确实有效,但您需要在拖动处理程序中手动更新位置,因为相对CSS定位在SVG内不起作用。 svg.rect(20,10,100,50, 10, 10, {fill:'#666'}); svg.rect(40,20,100,50, 10, 10, {fill:'#999'}); svg.rect(60,30,100,50, 10, 10, {fill:'#ccc'}); $('rect') .draggable() .bind('mousedown', function(e ...
  • 我认为它应该如此简单 text.attr({ text: 'my new text'}); 所以 setTimeout( function() { text.attr({ text: 'my new text'}) }, 2000 ); 会测试它 I think it should be as simple as text.attr({ text: 'my new text'}); so setTimeout( function() { text.attr({ text: 'my new text'} ...
  • 原因是你实际上不使用路径,而是使用填充的形状。 你只能用这种方式制作动画,而不是填充物。 在这种情况下,笔划是每个字母的(不可见)轮廓。 这就是为什么它不起作用。 问候, Ĵ the reason is that you actually don't use paths, but shapes with fills. You can only animate strokes this way, not fillings. The stroke in this case is the (invisible) ...
  • 你的小提琴有两个问题: 你没有包含jQuery。 您的SVG元素与按钮重叠,因此按钮位于SVG后面,无法单击。 在CSS中放置position: absolute; top: 0; position: absolute; top: 0; 或者将它放在某个地方,不要重叠。 比如这样