Member Avatar
I had a function I used a while back to test the pixel colors in a given screen rect, it was something like this pseudo code. ... I am wanting to update this code to something, well... better, and faster. But I don't know how to iterate through the array …
by Suzie999 213 in Software Development ()
Member Avatar
This Go snippet calculates the minimum number of bills or coins needed for a given amount of money (change) requested. The program also gives the denomination and number. US curency is used in this example, but can be changed to another currency.
by vegaseat 1,720 in Computer Science ()
Member Avatar
Another little adventure into Go coding. This time a slice (a Go open ended array) of structures is used as a record for some data processing. For those who miss the ; at the end of a line of code, you can use them, but the lexer of the compiler …
by vegaseat 1,720 in Computer Science ()
Member Avatar
I have the following struct definition: ... And the following vector definition: ... In the code I use the following statement to sort the vector elements by fsize: ... This works perfectly well, but how can I sort by the field "filename" when i.fsize = j.fsize ? (The vector is …
by it@61@sec 14 in Software Development ()
Member Avatar
I'm working on this code for class, I am not expecting anyone to do my homework but help would be appreciated. Nodes are confusing for me and my professor did not explain well. The errors I am getting are where I declare the functions, I dont know the nodeType(?) that …
by kortneycoles in Software Development ()
Member Avatar
Hi! I was doing my exercise of C Language. In the exercise I was encountered by a question in which author says you to perdict the correct answer; I was uable to perdict it, so I compiled it to get the answer, the source code is this: It yields this …
by oanahmed in Software Development ()
Member Avatar
Okay. This weeks 'problem' is that I need to simulate a game. I have to make two singly linked lists which will contain a name of player, his attack (double/float) number and his defence number and so on for as many players as the user inputs. The point of the …
by Stefan_2 in Software Development ()
Member Avatar
I have a linear array of structs. These are constant structs and is a way of holding a simple table. Now though I need to add another "column" to the table (another member in the definition of the struct) and I'm wondering if I'd be better using a class rather …
by owenransen 14 in Software Development ()
Member Avatar
Hi, I have such simple structure in unmanaged C++: and C# marshalled structure: When I pass C# struct to C++ lib by function and print passed values in C++: it prints: 232 <EMPTY LINE> 192.168.0.232 n What am I doing wrong?
by bejfake in Software Development ()
Member Avatar
I wrote a game using an array of structs to represent a 9x9 grid. Now I'm re-writing it as a class to '++ it up' a bit and to better understand classes. Part of the game used a seperate struct to keep track of selected board squares (to see if …
by jkhippie in Software Development ()
Member Avatar
Here's a little program i wrote, i'm trying to pass my structure book to function input. The code works fine on Code::Blocks but VS12 is giving an error on compliation " error C4700: uninitialized local variable 's' used ". What i'm doing wrong?
by waleedahmad in Software Development ()
Member Avatar
Hello, Am new in Struct I followed link for making simple hello project in struts using eclipse but when i complete the coding and go for the execution, when I write the word in that box as an input (for saying hello). and click on Say Hello button, it gives …
by Priti_P in Software Development ()
Member Avatar
I'm working on a struct array and I need to dynamically delete elements from the struct. I have the added dynamically but I've run into some issues with deleting. I've researched different methods and tried a few. I found that one from here works, in that it will delete the …
by melonhed85 in Software Development ()
Member Avatar
I have a void function that takes data from an ifstream, reads the first value, (which is an ID #), and compares that value against the ID# info from an array of records. If it's invalid, the rest of the line is ignored. If it's valid, it adds the hours …
by robert.speciale in Software Development ()
Member Avatar
How do I define a typedef struct in function f1() and pass a pointer to function f2() without a global definition of the struct. For instance: Also I would like this to be in C but not in C++. I have no toolbar, so I cannot put the code I …
by achava in Software Development ()
Member Avatar
I'm not sure if I'm freeing the memory correctly. I have the following struct and I'm trying to free the pointer in it. In my main function I have an array of this struct, therefore I'm using a loop to free it. But then, to test if it worked I …
by JE821 in Software Development ()
Member Avatar
I'm coding a contact manager using a doubly linked list that is manipulated by functions using pointers that reads in a contactList.txt file.But when I coded the first function to do a search I got the following error list: I checked the errors and some of the errors don't make …
by johngorman in Software Development ()
Member Avatar
I would like to convert a procedural database program that I have created to an object oriented program. In my procedural program I use a struct: Putting this into a class would I simply use: Originally I passed the struct between functions, for example: Can I do the same with …
by Hey90 in Software Development ()
Member Avatar
Hi, I've not worked in C, C++ from like 5-6 years. But now I got to do a very small change (explained below). I tried reading tutorials but only got confused. Below I've struct containing 2 attributes. I need to create its refrence and pass values to these 2 attributtes. …
by raul8 in Software Development ()
Member Avatar
guys I wrote this, there's no errors, no warnings... but it keeps crashing on execution.. any ideas ?????
by ehsann.sharif in Software Development ()
Member Avatar
Develop a telephone directory which is capable of doing the following: Insert a contact Delete a contact Edit an existing contact (changing or modifying a record) Search a contact (and display complete record on screen) a. Search through first name b. Search through last name c. Search through landline d. …
by arslanh in Software Development ()
Member Avatar
Hey guys, So I've thoroughly gone through the topics by searching this site but I couldn't find something which can help me. I'm making a task for my friend and let me tell you that it's been a year or more since I've used C++. I've moved on to C# …
by Major Aly in Software Development ()
Member Avatar
I want to sort the elements of block tomb by age which is the first variable of struct nevsor_t. The elements are added manually from the keyboard: And the problem is with this line: return *ia->age - *ib->age; "ia" and "ib"---pointer to incomplete class type is not allowed. Any ideas …
by VergilDevil123 in Software Development ()
Member Avatar
Hi. Im trying to write a simple deck of cards program. I am having difficulty in expressing my integer deck into a printable form. The deck is generated as this: 00102030405060708090100110120011121314151617181911011111210212223242526272829210211212203132333435363738393103113123 The leading numbers assign to suits and the following number assign to card rank. Basically how can I convert …
by jongiambi in Software Development ()
Member Avatar
hello everyone i'm new ic and i have a problem on structs, on the very simple i want to create a struct with one int and a char table 3 potisions,this is my code i want to put on my keyboard the values 5 a b c and it should …
by ntggl19 in Software Development ()
Member Avatar
Hi everyone, I'm currently working on a school assignment and came up with this error saying 'list_t has no member named head' but when I actually look at list.h and list.c (my code accessing list is in a separate file), head is in list.c. What did I do wrong? and …
by sandy.phan.37 in Software Development ()
Member Avatar
The question asks: Write and compile a C++ program that simulates the arrivals of airplanes at Regina airport. An airplane is represented using a C++ struct. Each plane belongs to an airline, such as United, and records the city from which it is arriving, for example Chicago. The airport is …
by jongiambi in Software Development ()
Member Avatar
How do you read a input file into a structure in c++? Say for example you have an input file with 5 names. And a structure such as The input file is structured like: Justin Williams 95 Tracy Williams 34 How do I get the names and the respective grade …
by jwill222 in Software Development ()
Member Avatar
So, I'm using allegro game programming library. Before I move on to bigger and better things I wnat to get a handle on pointers. Specifically with things like structs, linked lists and maybe binary trees in the future. I posted a program that uses a linked list to keep tracks …
by dancks 4 in Software Development ()
Member Avatar
Hi everyone, I'm facing problem in deleting a node in del() used in my program. Suppose, i've added a city as Delhi, and at the time of deleting, i type the name as delhi, the compiler gives a processor fault. But, i want it to display the line number 95. …
by Vish0203 -6 in Software Development ()