I have initialized a structure of static with function name as shown below. We have to initialize a static structure with constants. Is function names are constants in C? struct fp { int (*fn)(); }; int f1() { printf("f1 called \n"); return 0; }
For example i have a program with this structure: Domain logic module -> Settings module -> Settings store backend Next is a part of Settings module. def load_from_json(self, json_str): try: self.load_from_dict(json.loads(json_str)) except ValueErro
I've been creating a normalised, basic structure for a microsoft access database. It looks like this. I want it to have first, second, and third normal form normalisation. Not concerned about adding more fields because I believe the basics are there.
I am working on a project in which I am supposed to organize a customer’s bank account information using structures and pointers. I am getting an error in the initialize_CD_account function. The error message says "uninitialized local variable 'a' us
I wanted to know how could i make my code better by declaring the array 'data_pack[]' as a private .Im working in embedded field so i have limited RAM and Memory and all i wanted to do is two things. 1.I have a serial UI which gives me serial data of
Okay so I've found a better way of accessing my files but I'm still a bit stuck. My code so far: clc % clear window clear %clear workspace numfiles = 21; data = cell(1, numfiles); obsdata = dir('*.mat'); numfiles = length(obsdata); data = cell(1, num
I am basically trying to pass structures (complex objects) as arguments to a rest based service. Uptill now I know pass primitive types in URIs as varname=value&varname2=value. My Question is how to pass structures containing multiple fields to t
The scenario at play is that I have an ordered list of items. I want to convert that list into a single string. However. It's not simply a matter of converting each item into a string and concatenating. I need to do some processing on the list as par
I am trying to pull info from multiple arrays and then echo it out. Unfortunately, I am having some trouble and I am almost positive it is something wrong with my for loop structure. Lets assume: array1= 1, 2, 3 array2= toronto, new york, paris The c
I am using Unity to build a visualisation of a serious game. I am using C# programming language. My problem is that I receive data from a JSON and I parse it and I end up with a list of different 'words' saying for example: Player - walks to - Carl o
Inside the text file, the first number is number of albums, second is number of tracks associated with a single album, and the number infront of each track title is the character length of the title. Right now I am having trouble scanning in the name
I'm trying to rebuild a binary tree but I'm not sure if I did it right, so if you can give me your opinion It would be great. I have this: postOrder: 1 8 5 17 23 19 9 41 53 43 64 80 72 56 32 -----------------------------------------------------------
I have a fairly simple question in Matlab. I want to copy n items of structure array (sumRT.P) to a matrix (m). In C, I would just use a for loop, like this: for i = 1:n m(i) = sumRT(i).P; end But I bet there's a simpler way to copy an array in Matla
I have two structures: Dim testTransakcje(1) As Transakcje Private Structure Transakcje Public kontrahentNazwa As String Public listaTowarow() As Towary End Structure Public Structure Towary Public towarSymbol As String Public towarNazwa As String Pu
I have a C program which initializes two structures and tries to print their values. Please see the code below. #include<stdio.h> #include<stdlib.h> typedef struct node{ int data; struct node * next; }node_t; typedef struct bstNode{ int d
I have the following code: include <stdlib.h> typedef struct foo{ int x; }Foo; void funcY(Foo *f1) { printf("%d", f1.x); } void funcX(Foo *f1) { printf("%d", f1.x); funcY(f1); <---- is this correct? } int main() { Foo *foo1 = (struct foo *)m
#include<stdio.h> #include<string.h> #include<malloc.h> typedef struct male_node { int mv1,mv2,mv3; }male; typedef struct movie_name { char mvnm[20]; struct male *ml; }movie; main() { movie mov1; mov1.ml=(male*)malloc(sizeof(male));
I'm working on my assignment and I'm currently stuck in an error which I don't know how to solve. I've got a function add_name where I try to add a node to a doubly-linked-list, but the structure is not recognized inside the function, giving me the f
I come from Java background and trying to understand C structures, pointers and arrays better. Here's the sample code that I am playing with: If the following works: #include <stdio.h> int main(void) { char string[] = "Hello"; printf("%c",strin
I have two different implementations right now on how to modify a base workspace structure from inside a function. For my structure declaration in the base workspace: arg = struct('aa', struct('abc',30)); The first function that I tested uses the eva