Member Avatar

I have a union named un. I have a un* named up that is the address of a un named u1 (bear with me). The pointer works fine, but I can't pass it to a function. Any alternatives? Here is some code to illustrate (please tell me if there is some stupid mistake): [CODE] union un { bool a; int b; char etc; }u1; un * up= &u1; void randomFunctionName (un* up) { up->a=true } [/CODE]

Member Avatar
+0 forum 2
Member Avatar

Hi ~ As you can see from the code below I am in school for programming. I have come across this homework assignment a few times on the site already however the requirements for mine are different. I cannot use arrays. Three functions - I only have two coded. The void calcAverage prototype is not causing an error and the program compiles and runs asking the using for the five test scores with no problem. I cannot find the error in passing the 'lowest' score value. Upon the user (me) entering the five scores, the lowest score value is always …

Member Avatar
+0 forum 8
Member Avatar

I was trying to code the assembly line sheduling problem using the dynamic programming approach. I have coded the program but i am facing problem with the 2-dimensional arrays I am using. For testing purpose, I wanted to initialize the array, but I was not able to get it. Moreover, as most of the arrays I am using are dynamically allocated, They were not getting passed to functions. Though I have made the program working with some tricks but I would really appreciate if someone helps me improve it. [CODE]#include<iostream> using namespace std; //Had to make much of the variables …

Member Avatar
+0 forum 3

The End.