Hi, I'm writing in C my program and I have a problem with this pieces of code: //lib.h typedef struct Array { char **array; char *searchDirPath; char *searchFile; char *tmpFileName; int tmpFile; int arraySize; int currIndex; } Array; // lib.c Array* createArray(int size) { Array* newArray = calloc(1,sizeof(Array)); newArray->array = calloc((size_t)size,sizeof(char*)); newArray->arraySize = size; newArray->currIndex = 0; char fileName[] = "tmpXXXXXX"; newArray->tmpFile = mkstemp(fileName); newArray->tmpFileName = fileName; showYourself(newArray); return newArray; } void showYourself(Array* a) { printf("\n\n==========================================\n"); printf("\nShowing myself:\n arraysize: "); printf(sizeof(a->array)); printf("\nSearch directory path: "); printf(a->searchDirPath); printf("\nSearch file path: "); printf(a->searchFile); printf("\nTmp file: "); printf(a->tmpFileName); printf("\nArray size: "); printf("%d",a->arraySize); printf("\nCurrent …

Member Avatar
Member Avatar
+0 forum 2

I was wandering aimlessly on google, I found [ReactOS](https://www.reactos.org/). It's interesting. I tried this OS, many windows applications are running well on it. But some latest applications are unable to run like **Firefox 65.0.1** I have few questions, * How worth is using this OS? * What is future of this OS? * How secure is this OS? * What development is required to run latest applications? * How to search books & tuts, which are useful for this OS development? * Can anybody help me here to compile & edit some part of OS (I would like to do …

Member Avatar
Member Avatar
+0 forum 12

Suppose I create an asp.net website project that loads data into griview from the class library, declaring the library to use loading data for griview //file: ChitietSP.aspx using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Diagnostics; // Debug using connectSQL; // warning public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadData(); } } string sSQL; private void LoadData() { sSQL = "SELECT * FROM TABKHACHHANG "; sSQL += "ORDER BY MASOPHIEU;"; GridView1.DataSource = ClsConnecSQL.FillDatatable(sSQL); //warning } } //file: …

Member Avatar
+0 forum 0

So given the following code (not my actual code since it would add unnecessary lines): typedef struct block{ int a; int table[64]; }block; typedef block* block_ptr; void getValues(block_ptr node){ int i, j; for(i=0; i<5; i++){ for(j=0; j < 15; j++){ node[i].table[j] = j; } } } int main(){ block node[10]; getValues(node); printf("%d\n", node[4].table[2]); return 0; } Why does it print out garbage values instead of, in this case, 2? And how can I fix this issue? Thank you for your time.

Member Avatar
Member Avatar
+0 forum 1

I am starting a website where an image shows on the home page and when I scroll to hover over the image it opens a newpage. I’m trying to figure out a way to do a slow dissolve from the home page to new page and also if the user has a pop up blocker on how to get around from home page to new page that if there is a way. Here is the code I have now html: <!DOCTYPE HTML> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Daily Process</title> <script src="Scripts/jquery-1.10.2.min.js"></script>"> <link type="text/css" href="Content/dailyprocessbootstrap.css" rel="stylesheet" /> </head> …

Member Avatar
+0 forum 0

I'm trying to make this queue program for school to take the next packet out of my queue (therefore delete it) in the queue function : struct packet_t *queue_retrieve(struct queue_t *queue) in line 73. I know that i have to use my write and read but i fail to understand how exactly. I also have to implement it as a circular buffer so when it reaches the end of my queue it starts at 0 again. Also is it enough to free(q) and (p) in order to delete packets/queues like i did in the queue_destroy and packet_destroy functions or do …

Member Avatar
Member Avatar
+0 forum 1

HEEY EVERYONE ,hope you're doing well my teacher assigned us a homework wich is to create a program with C; this program takes as input a text file with some data in it .every line of the text file contains the ID of an employee and it's name and salary e.g 1 katy oath 100.34 22 bob jazy 3343.00 4 jonathan sayf 2000.00 and so on then sort them according to salary o the employee with the highest salary shold be at the firt ,so it should be like this : 22 bob jazy 3343.00 4 jonathan sayf 2000.00 1 …

Member Avatar
Member Avatar
+0 forum 1

Hi, does anyone know how to pass variables between functions in C so one function can recognise the variable passed from another function. one function knowing from another function like length = 0; while (length <= 5) { length ++; } return(length); getting the value of the length from the top to count in the bottom for (counter = 0; counter <= length;counter += 2) { printf("hey"); } these are two different functions and there is also void main help would be appreciated

Member Avatar
Member Avatar
+0 forum 2

Hello everybody, I want to convert python to c but ı did not find any converter. Is it possible to convert

Member Avatar
Member Avatar
+0 forum 1

hello. how can i print out in textbox a void * value ? here is the code: uintptr_t offsetFromBuffer = (uintptr_t)internalAddress - (uintptr_t)&buffer; void * healthDecAddress = (void*)(currentChunk + offsetFromBuffer); richTextBox1->Text = healthDecAddress; // how can i do it right ?

Member Avatar
Member Avatar
+0 forum 3

I am doing a team project with some people that prefer Linux and some people prefer Windows. We are also not allowed to share code for security reasons. One thing the Windows people love to whine about is a way to hold the window open. So the way they usually solve the problem is with: #include <conio.h> getch(); This creates a problem for the Linux users since we do not have that library. I have been looking for ways to solve this problem and I really like this idea. https://www.dreamincode.net/forums/topic/30581-holding-the-execution-window-open/page__st__30__p__575874&#entry575874 #include <stdlib.h> //For system commands //Detect and define which command …

Member Avatar
Member Avatar
+0 forum 3

I am trying to replace a string in a function with double pointers. I would like to see this change back in main. What am I doing wrong? These are the warnings my compiler gave me. $ gcc *.c -Wall main.c: In function ‘replacevalue’: main.c:10:12: warning: passing argument 1 of ‘strcpy’ makes pointer from integer without a cast [-Wint-conversion] strcpy(**pinput1, string); ^ In file included from main.c:4:0: /usr/include/string.h:38:8: note: expected ‘char * restrict’ but argument is of type ‘char’ char *strcpy (char *__restrict, const char *__restrict); ^~~~~~ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> void replacevalue(char **pinput1) { char …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a C++ program : // ConsoleApplication14.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <list> #include <queue> #include <vector> #include <string> using namespace std; class RectangularVectors { public: static std::vector<std::vector<int>> ReturnRectangularIntVector(int size1, int size2) { std::vector<std::vector<int>> newVector(size1); for (int vector1 = 0; vector1 < size1; vector1++) { newVector[vector1] = std::vector<int>(size2); } return newVector; } static std::vector<std::vector<bool>> ReturnRectangularBoolVector(int size1, int size2) { std::vector<std::vector<bool>> newVector(size1); for (int vector1 = 0; vector1 < size1; vector1++) { newVector[vector1] = std::vector<bool>(size2); } return newVector; } }; class Cell { public: int x; int y; int …

Member Avatar
Member Avatar
+0 forum 2

Hi I am trying to get windows positioned in specific order as show below ![desired.PNG](/attachments/large/3/6447240b1491d04046fa904f31659f9b.PNG) but I am unable to get and get always this ![wrong.PNG](/attachments/large/3/71f4b92c4f40a6afeeab7e3c2f136526.PNG) the code below is shown HDWP cmdWnds; cmdWnds = BeginDeferWindowPos(col.size()); for (int i = 0; i < col.size(); i++) { if (i == 0) { if (DeferWindowPos(cmdWnds, col[i], HWND_NOTOPMOST, x_pos_start_pr + i * x_offset_pr, y_pos_start_pr + i * y_offset_pr, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW) == NULL) return ERROR; } else { if (DeferWindowPos(cmdWnds, col[i], col[i - 1], x_pos_start_pr + i * x_offset_pr, y_pos_start_pr + i * y_offset_pr, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW) == NULL) …

Member Avatar
+0 forum 0

i am new to c programming and i wanna ask for help. at the end of the coding part, how can i print out the orderlist, the quantity and the total price for the food? I personally think that it is similar as print out a reciept but i have no idea how to do it. #include <stdio.h> #include <stdlib.h> #include <time.h> #include <ctype.h> #include <math.h> #include <string.h> #include <conio.h> void menu(); float Bfast(); float Lunch(); float Dinner(); float Bvrg(); float total(); void displaybreakfast(){ printf("\n\n\t[A] A COURSE: Chinese DimSum (SiuMaai, HaGaau, CheungFan, Juk(each come with 3 sets))----RM33.99"); printf("\n\t[B] B COURSE: …

Member Avatar
Member Avatar
+0 forum 1

Above program takes input of coefficient and power separately of 2 different polynomials add them up to a new polynomial.It is successfully compiled and executed in DEV CPP as C file.It Turbo C compiler add void before main function to avoid warning messages.

Member Avatar
Member Avatar
-1 forum 7

i need a code for authentefication user and password with c languge the user and password should be filled first in a .text

Member Avatar
Member Avatar
+0 forum 1

So I have a poker type program where it should shuffle and deal a deck of cards using arrays of pointers. I have to write a function that uses a pointer(s) to determine if the hand contains an Ace. If I can understand this one, I'd be able to do the rest with no problems. I was told to do what I did with int decks, int dealt, int the_hand, but I keep getting errors. I've been trying everything I could think of, but no luck. Am I even in the right direction? Also, I read the book, reviewed my …

Member Avatar
Member Avatar
+0 forum 12

Hello everyone. I am a newbie in C programming and I have a quite challenging task to do. I am supposed to write program where user enters a number (for example a number that user wants to get from cashpoint) and the program gives me as best solution as it's possible. When user enters 215€, programs tells me it's 200€ and 10€ and 5€ (100€ and 100€ and 10 and 5 would be wrong, because it's not the biggest cash that user can get). I would be really grateful if somebody helps me. Thank you so much, Alisha.

Member Avatar
Member Avatar
+0 forum 1

im just new on c program can you help me on this ? problem : make a C program that will ask 10 numbers and store into an array. the numbers to be entered must be between 70 to 95 only output the average,number of grades below average, above average. if more grades are below average , will display " review your lesson" else " proceed to next chapter "

Member Avatar
Member Avatar
+0 forum 3

I want to create a game that computer guesses the number that i think between 0-500 but i am a beginner and i do not know what to do could you help me please ?

Member Avatar
Member Avatar
+0 forum 1

I see the software to charge credit card swipe, samsung pay, ... I want to find out how the swipe card works and write code to get payment information in the software sales. how ? You can share the code for me with.

Member Avatar
Member Avatar
+0 forum 1

Hey, I don't know if this is the right place, but my issue is taking an output from a software SPI and using it in another function for temperature. The code below is marked with my issue, however it's not the full code. The full code is for a lab assignment to display temperature and a clock on an LCD, and the clock is another problem on its own. Thanks in advance for any help. unsigned int SW_SPI(unsigned int Output) { bitClear(PORTC, CS_Bit); for (int i = 15; i >= 0; i--) { bitSet(PORTB, SClk_Bit); if ( PINB & 0x01){ …

Member Avatar
Member Avatar
+0 forum 1

How can I make this to continue until the user presses N? I've tried using while(1), while( option == 'y' || option == 'Y') but it kept giving an error for that, and if/else statements but no luck. So I decided to try a do while statement and same results, it seems it is working, but I don't know what I'm doing wrong. I even tried moving all the statements to different areas and still nothing. #include <stdio.h> #include <time.h> #include <stdlib.h> enum meme {YEE, KNUCKLES, DOGE, HARAMBE, BUTKUS}; int dankestmemes(void); // function prototype int main(void) { srand(time(NULL)); // randomize …

Member Avatar
Member Avatar
+0 forum 10

I have 30 functions like this void func1(int *var1, int *var2) { func2(var1, var2); } void func2(int *var1, int *var2) { func3(var1, var2); } void func3(int *var1, int *var2) { func4(var1, var2); } I do not need var3 until func15. Is there a way to fix this mistake without having to change all the function calls and headings? var3 needs to be remembered every time I get to func15. I only use var3 in func15 though so I really do not want to have to change all of my function calls and headings. It obviously can't be a local variable …

Member Avatar
Member Avatar
+0 forum 4

This may sound wierd, or easy, I just don't have a statistics background. How do I alter the statistical value of an array of emmitted random numbers? I am completely capable of using ranges, or creating an algorithim, I just need pseudo code or a brief description to guide me through the process. This is not homework. This would mean I essentially generate randoms, and the final result has a statistical probability. Thanks!

Member Avatar
Member Avatar
+0 forum 3

If you have a counter that gets incremented through multiple functions, is it better to use a global counter or pointer counter? They both work just curious which is better and why.

Member Avatar
Member Avatar
+1 forum 3

Can someone give me the code of this program: Write a program that convert the numbers of length upto 3 into words and speech.Use either if else or switch case only

Member Avatar
Member Avatar
+0 forum 1

Hi guys, I took it upon myself to learn the mysteries of linux. I'm trying to write a shell that can handle more than one pipe. Here's the code: [CODE] typedef struct command_link{ char *command; char *argv[MAX_ARGS]; int argc; struct command_link* next; int isPiped; }command_t; int pipedCommand(command_t *command) { int fd[2]; int status; int isFirstPipe = 1; int pid = -1; status = pipe(fd); if (status < 0) { printf("\npipe error"); return -1; } while (1) { pid = fork(); if (pid < 0) /*handle fork error*/ { printf("\nfork error"); return -1; } else if (pid == 0) /*handle son …

Member Avatar
Member Avatar
+0 forum 5

Hi guys I was having issues with reading 3 files and merging them into an array, I tried fgetc, which then let me to have issues with sorting them so I tried to change my array and allocate a counter variable to get the size of it but not sure which method would be best to read and insert into an arrat I tried a few ways which I commented below, however I get errors for both. I'm a bit lost when it comes to arrays and pointers. any help is appriciated. :) #include <stdio.h> #include <stdlib.h> #include <string.h> int …

Member Avatar
+0 forum 0

The End.