C

22K

Solutions

20

Articles & Videos

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

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
Technology Partners: We Want Your Opinion!
Technology Partners: 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!

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
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 have following version of eclipse installed in my computer:

Eclipse IDE for C/C++ Developers

Version:  Neon.1a Release (4.6.1)
Build id:  2016 1007-1200

From main menu, I go to Window  -   Preferences  -  Indexer   but Indexer doesn't run ?

I need to run Indexer so I can navigate my source code.
0
Attached is data dump of some example symbol "ast".  This symbol starts at address 0x0000 6814.

What is oriented display and what is line break at 2 power x ?
Orient-Display.PNG
0
Hello everyone,

I am making a code where I should display date and time in the beggining, so since I am still a begginer in C, I found some codes to display it.
#include <stdio.h>
#include <time.h>
void timeNdate();
void main(){
timeNdate();  
getch();
}
void timeNdate(){
char date [6];
char time [6];
_strdate( date );
_strtime( time );
printf("DATE/Time:  %s / %s",date,time);
}

I want to know what is _strtime and _strdate and how are they used, I need to explain this to my professor at the end.
Thank you very much for your help!
0
#include<stdio.h>
#include<conio.h>
#include<ctype.h>

main(){
	char first[100], last[100];
	int i, mon, c, dd, mm, yyyy;
	long double bor, lend, total, term;
	long long long id;
	
	clrscr();
	printf("Lending System\n\n");
	printf("Input Lender ID#: ");scanf("%11d", &id);
	printf("\nLast Name: ");scanf("%s", &last);
	printf("\nFirst Name: ");scanf("%s", &first);
	printf("\nAmount to lend: ");scanf("%Lf", &lend);
	
	printf("\nDate lend: \n");
	Date:
	printf("\n DD [01-31: ");scanf("%d", &dd);
		if (dd<1 || dd>31){
			printf("Enter valid date.");
		goto Date; }
		
	Month:
	printf("\n MM [01-12]: ");scanf("%d", &mm);
		if (mm<1 || mm>12){
			printf("Enter valid month.");
		goto Month; }
		if (mm>0 && mm<13){
			if (dd==28 && mm!=2){
			printf("Enter valid month.");
		goto Month; }
		if (dd==31){
			if(mm==2 || mm==4){
				printf("Enter valid month.");
		goto Month; }
			else if(mm==6 || mm==9){
				printf("Enter valid month.");
		goto Month; }
			else if(mm==11){
				printf("Enter valid month.");
		goto Month; }
		}
		if (dd==30){
			if(mm==2){
				printf("Enter valid month.");
			goto Month; }
		}
	}

Year:
printf("\n YYYY: "); scanf("%d", &yyyy);
	if(dd==28 &&mm==2){
		if(yyyy%4 !=0){
			printf("Enter valid year.");
		goto Year; }
		}

printf("\nInterest Increase: 5%");
printf("\n\nTerm in Months: "); scanf("%d", &mon);
total = lend*1.05;
term = total/(long double)mon;
		
for (c=0; c<100; c++){
	last[c] = toupper(last[c]);}
for (c=0; c<i; c++){
	first[c] = 

Open in new window

0
Hi
I am connecting GSM(SIM 800) module to my PC through serial to USB. I want send SMS to GSM module by PC .
using COM4 port serial communiction in PC(windows 7).
I tried writing this code
#include<stdio.h>// include stdio . h
#include<stdlib.h>// include stdlib . h
void initialize_GSM_modem(void);
void initialize_serialcommunication(void);
unsigned char Command_CMGF[]="AT+CMGF=1\r";
// AT+CMGF for selecting Text Mode
unsigned char CtrlZ=0x1A;
// CTRL+Z for sedning SMS after the message has been entered
unsigned char Command_CMGS[]="AT+CMGS =+9233385xxxxx\r";
// recepient mobile number
unsigned char Command_AT[]="AT\r";
unsigned char msg02[]="Hello!";
void main (void) {
initialize_GSM_modem();
initialize_serialcommunication();
while (1) {
;
}
}
void initialize_GSM_modem(void){
delay2();
puts(Command_AT);
delay2();
puts(Command_CMGF);
delay2();
puts(Command_CMGS);
delay2();
puts(msg02);
delay2();
}
void initialize_serialcommunication(void){
 HANDLE hCom;
 DCB dcb;
BOOL fSuccess;
   TCHAR *pcCommPort = TEXT("COM4"); //  Most systems have a COM1 port

   //  Open a handle to the specified com port.
   hCom = CreateFile( pcCommPort,
                      GENERIC_READ | GENERIC_WRITE,
                      0,      //  must be opened with exclusive-access
                      NULL,   //  default security attributes
                      OPEN_EXISTING, //  must use OPEN_EXISTING
                      0,      //  not overlapped I/O
                      NULL ); //  

Open in new window

0
Cross compiling a program - compiler creates the object file but the native linker is being used and failing.
I am feeding the linker as a command line argument to make (as LD).

How do I specify an alternate linker?

Thank you.
0
I have been up the last three nights being paged about high cpu usage on AIX 7.1
I can run nmon the press c then press u and nmon displays the top cpu processes/programs

is there a way to run that in a script and capture the output?

any help would be appreciated
I have tried several options to put the info in a file but cannot get the output desired
the summary of top cpu when running the command includes
PID %CPU ResSize Char Command - don't really need the Char column
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!

Hello All,

I have been trying to get some assistance and received various inputs in one of the earlier question to run a .bat file on multiple servers.
Below is the steps I want to execute:

a. We have 109 server (Windows 2012 Server)
b. There is a batch file in D drive with same name and location on all 109 servers
c. I want to run that particular batch file on all servers in one go
Usually when I login to my session using credentials and launch the batch file, multiple command prompt windows start loading. When I used PSexec script it works for individual machine but there too I had a challenge... If my PC gets locked the batch file fails and stops.

All I am looking here is to run that particular batch file on all servers and if I login to my session I should see it has started. I want the batch file to run under by login session. Please help as this is very critical to be completed ASAP.

Let me know if any more information required.
1
flow chart tower of hanoi graphical representation in c language and flowchart of  stack how to use of tower of hanoi
0
write a program for airline ticketing system?
Today's price of ticket from LA to Washington DC is 500 $, California 400$, Victoria 8oo$, there is half ticket for Childers bellow 12 years of age and infants bellow 4 years of age will be charged 100$ each for any destination and all the registered clients will get 10% off.
write a program to ask the client either he is a registered user or non-registered. Then ask how many passengers they want to travel, ages of all the passengers, destination where they want to go. Finally print the ticket like that.
For example:
 5 passengers want to get ticket for destination Washington Online ticket from LA to Washington 5 passengers
1. 40 year male--- 500
2. 35 years female--- 500
3. 15 years male --- 500
4. 10 years child--- 250
5-3 years infant 100
Total 1850 $ You are registered user will get 10% off Total 1665 $
Do you want to purchase another ticket Y/N
0
Hey..
  i want to create an image file of C drive of my server .. with all S\W ... When i run that iso file or create neew server at that time with all application it must be get installed .. is it possible ... pplz help ..
0
Within Outlook, I can navigate through a number of screens to eventually see the Certificate Properties screen for a single user.

Selecting the Details tab and choosing the Subject field, it displays these lines:

CN=
OU=
O=
C=

Each is followed by a specific value.

Using VBA code, how can I read the values that are displayed here?

I read somewhere these may be stored in the Global Address List (GAL), so I am including those words too just in case.

Thanks!


Dennis
0
how to fetch date from pgsql  by using pro*c
0
How to add number of files in linked list and do some file operation read, move,delete..

Is it possible to add many files in linked list.. (Single or double linked list.)?
0
I have not able to ping the router from ASA and unable to ping mgmt interface from the router.
current topology loos like ROUTER (192.168.2.1) ---> ASA (Standby/Active) ------> Switch 1 and 2.
Your help is much appreciated. Thanks.
-------------------------------------------------------------
System IP Addresses:
Interface                Name                   IP address      Subnet mask     Method
Ethernet0/1              DMZ                    192.168.3.111   255.255.255.0   manual
Ethernet0/2              FailOver               172.16.254.254  255.255.255.0   unset
Ethernet0/3              inside                 192.168.2.211   255.255.255.0   manual
Management0/0            mgmt                   192.168.4.1     255.255.255.0   manual
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Gateway of last resort is 192.168.2.1 to network 0.0.0.0

C    172.16.254.0 255.255.255.0 is directly connected, FailOver
C    192.168.4.0 255.255.255.0 is directly connected, mgmt
C    192.168.2.0 255.255.255.0 is directly connected, inside
C    192.168.3.0 255.255.255.0 is directly connected, DMZ
S*   0.0.0.0 0.0.0.0 [1/0] via 192.168.2.1, outside
APOLLO# ping 8.8.8.8
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
?????
0
Two vehicles update their position using latitude and longitude using .csv file. Plot the graph for two vehicles in a single graph to detect the collision.
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!

Hi,
I'm looking for an experienced Mac OS X kernel programmer. If are one, or if you know of one, please drop me a message.

Here are the basic details of the project:
- Build a driver to detect if the machine is connected to my proxy.
- If not, block all access to the Internet (disable the network adapter?).
- It should be tamper proof

Currently, a gross estimate will suffice.

p.s. We currently employ a Widows solution for the above, now we're looking to expand to Mac OS X too.
0
When opening Hyper-V Manager I get
"mmc cannot open the file c /windows/system32/virtgmt.msc"

Logged in a domain administrator.  User account in control panel shows it in the administrator group.
Any idea how to fix that?
Thanks
Karl
0
So I would like to make this program read a user inputted matrix instead of the one that is provided in the main function. Also, the limit to the 2d matrix should be more than 9, but no more than about 100 and should also be user defined.

The main function purpose that I had in mind would be something like:
int main(){
    int graph[V][V];
  printf("Enter number of towns: ");
  scanf("%d", V);
  printf("Enter distance matrix");
  scanf("%d", graph[V][V]);
  dijkstra(graph, 0);
return 0;}

Open in new window

which is giving me a great headache trying to write.. Any help would be greatly appreciated. Thank you.


// A C / C++ program for Dijkstra's single source shortest path algorithm.
// The program is for adjacency matrix representation of the graph
  
#include <stdio.h>
#include <limits.h>
  
// Number of vertices in the graph
#define V 9
  
// A utility function to find the vertex with minimum distance value, from
// the set of vertices not yet included in shortest path tree
int minDistance(int dist[], bool sptSet[])
{
   // Initialize min value
   int min = INT_MAX, min_index;
  
   for (int v = 0; v < V; v++)
     if (sptSet[v] == false && dist[v] <= min)
         min = dist[v], min_index = v;
  
   return min_index;
}
  
// A utility function to print the constructed distance array
int printSolution(int dist[], int n)
{
   printf("Vertex   Distance from Source\n");
   for (int i = 0; i < V; i++)
      printf("%d \t\t %d\n", i, dist[i]);
}
  
// Funtion that 

Open in new window

0
@echo off
cls
setlocal EnableDelayedExpansion

SET arg1=%1
call %~dp0\ABMaster.bat

::#Get the number of arguments
SET /A ARGS_COUNT=0
FOR %%A in (%*) DO SET /A ARGS_COUNT+=1

::#Calculate thread count,thread start and thread end numbers only all three arguments are supplied.
IF "%3" == "" GOTO cont
SET /A a = %1%
SET /A b = %2%
SET /A c = %3%
SET /A tCount = (%c% / %b%)
SET /A tStart = ((%a% * %tCount%) - (%tCount%)) + 1
SET /A tEnd = (%a% * %tCount%)
:cont

IF %ARGS_COUNT% == 2 GOTO MIN_ARG
IF %ARGS_COUNT% geq 4 (
      :MIN_ARG      
            echo Incorrect arguments provided. Ending the job. Run the job with  correct arguments as shown in below example.
            set ERRORLEVEL=-1
            GOTO JOB_STATUS
      )
IF %ARGS_COUNT% leq 1  (
      IF "%arg1%" == "" (
            @echo Executing job without Parameters
            Java %JAVA_OPTS% -Djava.awt.headless=true -server -Xms1024m -Xmx2048m -XX:MaxPermSize=512m -XX:NewSize=64m -XX:MaxNewSize=64m -XX:NewRatio=3 com.abc.abcDriver AB-A0123-DLY >%BATCH_LOG%\CO\AB-A0123-DLY_%timestamp%.txt 2>&1
      ) ELSE (
            @echo Executing job with single Parameters
            FOR /L %%G IN (1,1,%arg1%) DO (
                  @echo Executing job with Parameter %%G
                  cmd /c start /b %~dp0TestParallelRun.bat AB-A0123-DLY %%G %arg1%
                  ping -n 6 127.0.0.1 >nul
            )
      )

      :checkfile
      FOR /L %%G IN (1,1,%arg1%) DO (
            if not exist %BATCH_LOG%\AB-A0123-DLY_T_%%G_%arg1%.txt GOTO checkfile
            )
      FOR /L %%G IN (1,1,%arg1%) DO (
            set /p value=< %BATCH_LOG%\AB-A0123-DLY_T_%%G_%arg1%.txt
      …
0
Hi,

I'm trying to build a legacy code base using Ubuntu.  ./configure is stopping when it cant find a library.  I have the drivers but i cant seem to install it.

vs_can_api library is missing.  How do i go about installing this library so ./configure can find it?

configure.ac is using this to determine the check - AC_CHECK_LIB([vs_can_api],[vscan_open])

Thanks
0
I am working on a html table and I want to set cookies from the table - that bit I think it okay but what I need to do then is to read that cookie ( from one big long cookie string) and break it down and repost it back to the table when I click my get cookie button.

 I am lost in how to get that bit to work -
EE-First-Sample-Code.txt
0

C

22K

Solutions

20

Articles & Videos

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.