Warning: Illegal string offset 'url' in /home/redho/public_html/forum/includes/page_header.php on line 381

Warning: Illegal string offset 'title' in /home/redho/public_html/forum/includes/page_header.php on line 381

Warning: Illegal string offset 'url' in /home/redho/public_html/forum/includes/page_header.php on line 381

Warning: Illegal string offset 'title' in /home/redho/public_html/forum/includes/page_header.php on line 381
Array copying problem - C programming forum - Programming Forums
redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Friday 14 December 2018 01:38

Ask your IT question here

Array copying problem



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> C programming forum
View previous topic :: View next topic  
Author Message
arun10427
New Programmer


Joined: 04 Mar 2010
Posts: 1
Hi I am trying to copy one struct to another, but I am making some minor mistake that it is not getting copied. Can someone help me fix it?

Code:

#include<stdio>
#include<stdlib>
typedef struct
{
    int inst_addr;
}instruction;

void copy_struct(instruction src,instruction dest)
{
    dest.inst_addr = src.inst_addr;
}

int main()
{
    int addr = 1000;
    instruction check1;
    instruction check2;
    check1.inst_addr = 10;
    check2.inst_addr = 50;   
    copy_struct(check1,check2);
    printf("%d",check2.inst_addr);
}       


Reply with quote
 
jammydoug
New Programmer


Joined: 16 Sep 2010
Posts: 4
Hi
Can anybody recommend a good book for a beginner to learn C++ programming?I am learning to do C++ programming for the first time. I have no prior programming experience. I am taking a college level programming class, and I am having a really difficult time understanding it. Any book recommendations are greatly appreciated.
_________________
Facebook apps

Reply with quote
 
hurel
New Programmer


Joined: 20 Sep 2010
Posts: 2
Hi,
This is really very good information you have shared with us about c programming. Hope u will share more in future.
_________________
iPhone applications

Reply with quote
 
fenglin
New Programmer


Joined: 30 Oct 2010
Posts: 4
fashion and healthy
_________________
The new concept of health mbt outletcheap mbt shoes,

Reply with quote
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> C programming forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo