C

22K

Solutions

13K

Contributors

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, so it has found lasting use in applications that had formerly been coded in assembly language, including operating systems as well as various application software for computers ranging from supercomputers to embedded systems. It is distinct from C++ (which has its roots in C) and C#, and many later languages have borrowed directly or indirectly from C.

Share tech news, updates, or what's on your mind.

Sign up to Post

I would like  to delete this account Basem Test from the users  list in C drive it wont let me delete it,  it says it is open in another program. How can i delete it ?
0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

If i delete the public user profile or entry from c drive--users--public will it cause any problems to my computer . will it be harmful to the operation of the computer?
0
Column B contains 241 numbers that are not listed in Column A.
The request is to be able to find and list the 241 numbers separately in Column C.
Missing-numbers-problem.xlsx
0
curl_easy_setopt (curl, CURLOPT_CAINFO, ".\\cacert.pem"); //https://curl.haxx.se/libcurl/c/CURLOPT_CAINFO.html

Having major issues trying to resolve this error.

-----Curl Readable Error Text...-----
error setting certificate verify locations:
CAfile: .\cacert.pem
CApath: noneProblem with the SSL CA cert (path? access rights?)-------------------------------------
"      char [100000]
CURLE_SSL_CACERT_BADFILE

it does not matter what I try this still failed I am sending a secure Endpoint. The normal endpoint work.
0
Hello,
Back when C# came out; I did not know how to pronouns this combination of C and a # (sharp).  Talking to a  developer, he chuckled when I said "C pound."
And now, when "reading" about generic decorators; it is not written as to  how to pronouns these;
*args, **kwargs
Might any one have the phonetics /fəˈnediks/ on these two decorators;
*args, **kwargs

Thanks
0
//************************** tracks indexs*******************
/*
each track saved in sd card has index , so to play track number we will using it's index 
for example to play track number 1 we will using "00003"  index which will send to play track function 
all the same for the rest of all tracks 
*/ 
char buffer15[6]={"00001"};  // track 15 index 
char buffer16[6]={"00002"};  // track 16 index
char buffer1[6]={"00003"};   // track 1 index
char buffer2[6]={"00004"};   // track 2 index
char buffer3[6]={"00005"};   // track 3 index
char buffer4[6]={"00006"};   // track 4 index
char buffer5[6]={"00007"};   // track 5 index
char buffer6[6]={"00008"};   // track 6 index
char buffer7[6]={"00009"};   // track 7 index
char buffer8[6]={"00010"};   // track 8 index
char buffer9[6]={"00011"};   // track 9 index
char buffer10[6]={"00012"};  // track 10 index
char buffer14[6]={"00013"};  // track 14 index

//*************************

Open in new window


How can I access these mp3files via filename not index
0
Is there a tool to calculate line checksum of motorola S3 Record ?

For example, following is line of motorola S3 Record:

S325A000002000000000000000000000000000000000000000000000000000000000000000001A

To calculate checksum manually, one byte of size, four bytes of address, and all data bytes are summed.  Extract least significant byte
from the sum, take it's one's complement and that's the checksum.

Is there a checksum calculator or tool that will calculate the checksum ?
0
Hi guys, m trying to make a program that can increment each character of a user input string bye 1 ,for example if the input =ABC then the output=BCD..I don't know how to do this if anyone can help me in this??
0
Hi, new member here and first post. My goal is to create a basic tab control using the Win32 API that contains a canvas for rendering OpenGL. Please see attachment for my source code. I created a tab control with two tabs; the first tab contains a button and the second tab contains the rendering context. The first tab, when active, successfully displays a button. The second tab, when active, does not display the OpenGL canvas. The only way I can get the canvas to appear in the GUI is to exclude the tab control (comment out the CREATE_TAB_PANE macro in my example to do this). I am rendering the OpenGL context within a static control. Thanks in advance for your help.
OpenGlTabWin32.cpp
0
I have installed 2 different IDM Ultrium-TD3 tape drives and in the 2nd case, I have ALSO installed the lin_tape and lin_taped (daemon).  I also have sg3_utils 1.42, built from source - all this are on x86_64 bit computers.

Many of the commands work, including sg_read_buffer for reading the cartridge memory.

The problem is, commands such as sg_read_attr/sg_write_attr (ioctl 0x8D, 0x8C) whether from a normal C program or from the sg approach, do not ever allow reading or writing the attributes - instead, it leads to an error, such as:

SG_WRITE_ATT_0803 command error: Host_status=0x05 [DID_ABORT]
Error : Write failed (try verbose opt)

I can try either generic /dev devices or /dev/IBM types of devices.  Each gives an error.  In one case, I have an idea for how to try to fix it, but I'm just wondering, is the firmware (mine is 6B20) just not implementing it?  I doubt that's the problem.  I can upload the firmware as hex code but I would like to see the source.

Also, I don't know whether or not running lintape/lintaped matters and whether or not the IBM-generic/IBM-specific/sg-generic drivers are the issue.  I'm trying to pin down what approach to go on next.  There are literally three sets of drivers.  And I don't know whether or not I should install Tivoli.

Given all the variables, I just want to know how to proceed to get to a working sg_read_attr/sg_write_attr command.  I even tried to start with the lowest numbered attribute.

I have also tried external …
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE
LVL 4
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Hi,

I am using window application. I want to use some cell in the columns as watermark text.

What is the syntax for that and how can we set this function in Win App c#.

My code :

 if ((dtGrid1[1,cnt].Value != null))
 {
                        dtGrid1[2,cnt].ReadOnly = false;
                        dtGrid1[2,cnt].value = "Enter" // Here i want watermark text for Enter
                        dtGrid1[2,cnt].Style.BackColor = Color.DarkGray;
                        dtGrid1.UpdateCellValue(2,cnt);
 }
0
Jane is very interested in programming and she often participates in various coding contests.  Since she is very interested in data structures and algorithms, she participates in the contest for data structures, where she was asked to write a code for the following functions:  

Define a structure:
struct node
{
int data;
struct node * link;
}
Include functions
append --- to add data at the end of the linked list.
Reverse --- to reverse the linked list.
display --- to display all the data in the linked list.

void append ( struct node **, int ) ;
void display ( struct node * ) ;
void reverse (struct node **);

How can you help her to write this code?

Input and Output Format:
Refer sample input and output for formatting specifications.
Sample Input and Output:
Enter the value:
9
Do you want to add another node? Type Yes/No
yes
Enter the value:
10
Do you want to add another node? Type Yes/No
Yes
Enter the value:
26
Do you want to add another node? Type Yes/No
Yes
Enter the value:
8
Do you want to add another node? Type Yes/No
no

The elements in the linked list are: 9 10 26 8
The elements in the reversed linked list are : 8 26 10 9

Sample Input and Output:
Enter the value:
90
Do you want to add another node? Type Yes/No
Yes
Enter the value:
118
Do you want to add another node? Type Yes/No
yes
Enter the value:
90
Do you want to add another node? Type Yes/No
Yes
Do you want to add another node? Type Yes/No
No

The …
0
Create a singly linked list of integers and input an integer z. Your task is to complete the function deleteAllOccurances which deletes all occurrences of a key z present in the linked list. The function takes two arguments: the head of the linked list and an integer z. The function should return the head of the modified singly linked list.
 
Input:
The first input has to be “num” denoting the no of elements of the linked list. Then in the next line are “num” number of space separated values of the linked list. The third line has to contain the integer z, whose all occurrences need to be deleted.

Output:
The space separated values of the linked list after deletion of the integer z.:

Sample Input & Output1:
5
2 2 1 4 4
Enter the element to be deleted: 4
The list after deletion: 2 2 1


Function Signature should be :
void insert(struct node** head_ref, int num)
void deleteKey(struct node **head_ref, int key)


Sample Input & Output2:
6
1 2 2 3 2 3
Enter the element to be deleted: 2
The list after deletion: 1 3 3
0
is uses "perl::a_file_name"  the same idea as an include file in C?
1
 

Author Comment

by:dwcronin
David Favor:
If you look at some of my last questions, you'll see that I rewrote all of my local cemetery's "internment books".  These are books that list things like: when/why people died. where they are buried, etc.  My sister got the job of bookkeeper for the cemetery.  I have free time and they don't know squat about making the information digital.  I spent about 15 months rewriting their books.  She also has maps of the cemetery which is broken into 5 divisions called sections.  Each section is divided into "lots".  Each lot is a set of 12 graves.  The internment books give the name of each person buried in the graves.  I have the digital information as an openoffice calc spreadsheet.  Since I am trying to learn perl, and I don't want to make the maps by hand, I want to get perl to do the work and somehow make the maps.  I used inkscape to draw some of the cemetery but I couldn't figure out how to get the information from the spreadsheet into inkscape.  This made me think that inkscape might be a mistake.  A previous expert mentioned learning javascript.  This is an option but I was seeing if perl can draw before moving to js.  I also looked at putting the sheet into mysql.  What I know is the digital form of the internment books is a useful form and I'm trying into     take advantage of it.  I really have no involvement but I thnk my sister is really overlooking a useful tool.
0
 
LVL 9

Expert Comment

by:David Favor
Start with how you'd like to present the data to users, including how they will query data.

I'd likely present this data as a normal HTML 4x3 or 3x4 table as what a user will see.

In your database, you'll have one table where each row contains section + lot + grave, so section=3 + lot=9 + grave=5 represents each cell in your matrix.

Then either store the actual grave information in another table or maybe just store this data as a custom HTML file, as each grave representation might be very different + representing ad-hoc in a database table can be tricky.

And yes, steer clear of Inkspace, use HTML tables to represent your data + you're coding will be much easier.

Tip #1: Since you're just starting your coding adventure, be sure you generate valid HTML. If you miss this step + generate broken HTML syntax, then you're debugging will be difficult, especially when someone contacts you + says the page their viewing is blank white or the layout is scrambled.

Use https://validator.w3.org/nu/ to incrementally validate your code.

Each time you make a code change, validate your HTML. Your target is 0 HTML errors.

Tip #2: Use WordPress. Once you start working with all this data, there will come a day when you'd like to do something like let people login + add information to their relatives gravesite. If you start with WordPress, you're life will likely be easier in the long run.
1
what is c language?what is it's necessity.?
0
Hi,

This is Ravi...

So far I read everything mentioned above...so I request you to provide one end to end example to do the same... because I am completely new to it...
0
I'm chasing what I think should be an obvious issue, but I can't find it.

The host is a Pogoplug E02 running Debian jessie.

Logged into the system as root, the following two commands turn the green LED on and off as expected.

root@www:# echo "default-on" > "/sys/class/leds/status:green:health/trigger"
root@www:# echo "none" > "/sys/class/leds/status:green:health/trigger"

Open in new window


Below is a little program adapted from one at https://github.com/suetanvil/ledflash/blob/master/ledflash.c.  To my mind this code should blink the green LED on and off a few times:

#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <syslog.h>
#include <string.h>
#include <sys/stat.h>

#   define FLASHFILE   "/sys/class/leds/status:green:health/trigger"
#   define ON          "default-on"
#   define OFF         "none"

void main() {
    FILE *ledfile;
    int status;

  ledfile = fopen(FLASHFILE, "w");
  if (ledfile == NULL) {
    printf("Unable to open '" FLASHFILE "' for write\n");
    printf("Error: %d (%s)\n", errno, strerror(errno));
    exit(0);
  }

  status = fputs("none", ledfile);
  sleep(1);
  status = fputs("default-on", ledfile);
  sleep(1);
  status = fputs("none", ledfile);
  sleep(1);
  status = fputs("default-on", ledfile);
  sleep(1);
  status = fputs("none", ledfile);
  sleep(1);
  status = fputs("default-on", ledfile);
  sleep(1);
  status = fputs("none", ledfile);
  sleep(1);
  status = fputs("default-on", ledfile);
  sleep(1);
  status = fputs("none", ledfile);
  sleep(1);
  status = fputs("default-on", ledfile);
  sleep(1);
  status = fputs("none", ledfile);

  exit(0);
}

Open in new window


The program's effect is exactly nothing. No error on the LED device file open, no blinking LED.  Clearly something is different between echoing the command from a console prompt, and writing it to the device from a program.  I don't know what it might be, though.

Any ideas?
0
I am in the process of moving legacy codes in c to Intel 64 (ksh) from Unix Tru64 (ksh).  
 I created a basic hello world application in c so I could setup the debugger.   INTEL has instructed me to use the gdb-ia debugger.   I don't know where any manuals are to read this for myself.   I have gotten a few errors along the way that have lead me to add the following lines to my ksh users .profile.  
 export LD_LIBRARY_PATH=/opt/intel/debugger_2017/libipt/intel64/lib
 export PYTHONHOME=/usr
 Currently I am getting an error:  $>gdb-ia ImportError: No module named site
 With every question I ask INTEL, it takes me a business day to get an answer.  So, I've had great luck with Experts Exchange in the past, so I'm back to get some direction.  
 My last correspondence with INTEL was:  
      "Looks like you forgot to source the environment."
        "#source /opt/intel/bin/compilervars.sh intel64"

 Where am I going to add this line of code?   The "#source" makes me think it would go into an include file somewhere.   Can anyone see through this and give me some advice???
 I also have another post out there for mapping Tru64 compiler options to INTEL.  

 Thanks everyone for your help!
0
Can anyone help with this?  I am porting a legacy c program from UNIX Tru64 to Intel64.  I have not had any luck in mapping the following options:
-source_listing
 -assume noaligned_objects
 -D_INLINE_INTRINSICS
-show source, header, statistics  

The complete compile options line is as follows:
 Tru64
 CGFLAGS=-source_listing -show source,header,statistics -assume noaligned_objects -O0 -D_INLINE_INTRINSICS

Intel64
I have identified -O0
I have not identified:
-source listing   I don't believe this is critical
-show source,header,statistics   I found -xc for source, but header is not the same, and nothing on statistics.
-assume noaligned objects   No information
-D_INLINE_INTRINSICS  No information
0
Independent Software Vendors: We Want Your Opinion
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Passing from RPGLE INT 10i 0 to C function
D Functx           pr                  ExtProc('C_FUNCTX')        
D  LenOfRcvVar           10i 0 const                              
D  InfoFmt                      8A   const                              

D WkSizeOfFmtX    s             10i 0
D WkFmtName8      s              8    

WkSizeOfFmtX    = 4520

 Functx (WkSizeOfFmtX:
               wkFmtName8);  

 extern "C"                            
 void Funct_x                          
          (int  info_size,
                const char* info_fmt);

Value of info_size always 2 ???  - why???   Could the field after the INT affect the value ???
0
I am currently looking for a way to detect if the "Pause Printing" option in the "See What's Printing" window is checked in Windows.

I've searched high and low, and looked into the Win32 native printing API (winspool) to see if there was such a detection available, but to no avail.

Is there anyone who has experience with a successful implementation of this detection?

I'm looking for a solution in either C/C++, or C#.
0
Hello!

I have a database (attached) and I want to be able to export the first two sheets to a PDF. However, the code I have now (below) which runs after clicking the Print Bid button, only converts part of the first worksheet. When the user is using this database there could potentially be many more work items and therefore I need the code to convert everything in all the columns to a PDF, except column C. That is the next problem, the Jump To column, column C, in the first worksheet should not be visible in the PDF but right now, despite the code, it is. If anyone has any suggestions on how to change these two things that would be wonderful! Thank you!

Sub PrintToPDF()
    Dim oWs As Worksheet
    Sheets("summary").Columns("C:C").EntireColumn.Hidden = True
    Set oWs = Sheets("summary")
    With oWs.PageSetup
        .FitToPagesWide = 1    ''/// prints to one page
    End With

    oWs.Columns("C:C").EntireColumn.Hidden = False

    With Sheets("service rates").PageSetup
        .FitToPagesWide = 1    ''/// prints to one page
    End With
    ''///Save the Array of worksheets (which will be selected) as a PDF
    ThisWorkbook.Sheets(Array("summary", "service rates")).Select
    On Error Resume Next
    oWs.ExportAsFixedFormat _
            Type:=xlTypePDF, _
            Filename:="Test.pdf", _
            Quality:=xlQualityStandard, _
            IncludeDocProperties:=True, _
            IgnorePrintAreas:=False, _
            …
0
I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.  

Consider stack starting address 0x5000 0000.  The stack size is 0x2000.  

If I take current stack pointer minus 0x2000, will that create stack exception?  If yes, what might be 'C' or assembly language code that will achieve this?

My thought is if I subtract negative 0x2000 from current stack pointer or add 0x2000 to current stack pointer, I'll be outside stack and stack exception will occur ?

 I need to set program counter to illegal address, i.e. 0x00FF FFFC.  Can this be done with assembly language instructions?
 If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running.
0
I'm trying to create illegal instruction reset.  

I'm programming Infineon TC29x Aurix Tricore Microcontroller based embedded system in 'C' language.  

I need to set program counter to illegal address, i.e. 0x00FF FFFC.  Can this be done with assembly language instructions?
If yes, please instrument assembly language instruction that would set program counter to 0x00FF FFFC while code is running.
0
I would like to implement a fast fixed point sine approximation for PIC24F microcontrollers on 16bit.
I started from here: http://www.coranac.com/2009/07/sines/
The approximation is done with polynomials: 3rd order up to 5th or even 6th order.
I am stuck in the beginning.
The 3rd order polynomial is S3(x)=(3/PI)*x-(4/PI^3)*(x^3) or S3(z)=(1/2)*z*(3-z^2) with z=x/(1/(2*PI))
I tried an Excel sheet for this function and I compared with sin() from Excel.
Either I make a mistake or the approximation error is too big.
Here is the Excel: https://goo.gl/2KJXj8 
Could you help to debug this?
0

C

22K

Solutions

13K

Contributors

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, so it has found lasting use in applications that had formerly been coded in assembly language, including operating systems as well as various application software for computers ranging from supercomputers to embedded systems. It is distinct from C++ (which has its roots in C) and C#, and many later languages have borrowed directly or indirectly from C.