[Solved] unable out figure out error in below program [closed]

This is a case of undefined behavior: if(!visited[j]) is undefined. visited is not initialized because the call memset(visited, sizeof(visited), false); is wrong. You are reading uninitialized variables. The declaration of memset is void *memset( void *dest, int ch, size_t count ); You are writting 0 times the value 10000 into visited. On your machine this … Read more

[Solved] How to upload (multiple) files to SharePoint Online using CSOM?

I tested the below code in my local environment; it works fine. <div> <asp:FileUpload ID=”upldGradeReport” runat=”server” /> <asp:FileUpload ID=”upldExpenseReceipt” runat=”server” /> <asp:Button ID=”btnSubmitForm” OnClick=”SubmitButton_Click” runat=”server” Text=”Submit” /> </div> protected void SubmitButton_Click(object sender, EventArgs e) { sendToSharePoint(); Response.BufferOutput = true; Response.Redirect(“Submission.aspx”); } protected void sendToSharePoint() { try { string siteUrl = “https://tenant.sharepoint.com/sites/lee”; ClientContext clientContext = new … Read more

[Solved] Sort array contains numeric string using c# array

You need give an order (actually a equivalence relation) to be able to sort. The order on characters is usually a,b,c,… and the order usually given on words such as ‘one’ is called lexicographic order. However you want to sort by the meaning behind, its semantic: integers. Your computer doesn’t know that you want this, … Read more

[Solved] C Programming with loops for exam

Your program should be #include <stdio.h> /* Readability is important. So, indent your code */ /* Notice how I corrected your code and also made it more readable */ int main(void){ int even = 0; int odd = 0; int x = 0; /* Initialize x */ /* int num; Unused variable */ while(x <= … Read more

[Solved] Work With Char Using If else in C Language

After typing the second number you press enter, right? %c in scanf accepts the first character it finds, so it returns the line break character corresponding to you pressing enter. An easy fix is to add a space character before %c. It makes scanf skip any whitespace. scanf(” %c”,&op); From the scanf documentation (http://www.cplusplus.com/reference/cstdio/scanf/): Whitespace … Read more

[Solved] Printing a Decimal Number [closed]

Following is the program #include<stdio.h> main() { //float f = 233.1234; float f; float s; int x; int unit = 0; printf(“Enter the decimal number \n”); scanf(“%f”,&f); printf(“Entered the decimal number =%f\n”,f); s = f; while((int)s % 10) { s = s*10; } x = (int) s/10; printf(“x=%d,s=%f \n”,x,s); while(x % 10) { unit = … Read more

[Solved] Expected identifier or ‘(‘

I don’t quite see the point of another file under the same project just to print powers of three, but that’s possibly your homework. Anyway, I think the whole point is to see how to include a file, so I also isolated the power function in another file. power_calculator.c will accept two parameters, {number} and … Read more

[Solved] Defining new data types in C [closed]

What you’re looking for is bitfields, but you’ve unnecessarily mixed those with union. Remember in a union only one member exists at any time. Also, there is not standard C type, which imho, takes 24bits or 3 bytes. So you may choose unsigned int which usually is 32 bits in size as I’ve done in … Read more

[Solved] How to get an image of each letter from image with text [closed]

As a basic technique, use binarization and connected component analysis. This will give you “blobs” corresponding to the individual characters and you can get their bounding boxes. You will face extra difficulties: some characters can touch and form a single blob. You will need some detection logics to split them, for instance based on size … Read more

[Solved] Correct printf formats for double numbers in C

%e specifier is used to print value of float\double in exponential format. So here %1.4e will print 1 digit before the decimal point and 4 digits after the decimal point. So if bmax=12.242 then the output will be 1.2242e+01. 3 solved Correct printf formats for double numbers in C